```
### Cleanup
diff --git a/docs/user-guides/observability-configuration.md b/docs/user-guides/observability-configuration.md
index 66617e874b..677781f191 100644
--- a/docs/user-guides/observability-configuration.md
+++ b/docs/user-guides/observability-configuration.md
@@ -5,14 +5,14 @@ By enabling observability, you can monitor and visualize the number of indexes,
This page shows the best practice for applying observing features by constructing an observability environment and setting the Vald Helm chart.
-## Arhitecture
+## Architecture
-Vald conforms [OpenTeremetry Protocol](https://opentelemetry.io/docs/reference/specification/protocol/otlp/) and does NOT depend on any commercial data format.
+Vald conforms [OpenTelemetry Protocol](https://opentelemetry.io/docs/reference/specification/protocol/otlp/) and does NOT depend on any commercial data format.
OpenTelemetry Collector handles receiving / processing / exporting the telemetry data, which does NOT depend on the vendors' format.
-All Vald components can send OTLP-compliant telemetry data, like metrics, traces, or logs, to the OpenTelemerty Collector.
+All Vald components can send OTLP-compliant telemetry data, like metrics, traces, or logs, to the OpenTelemetry Collector.
The telemetry data is used to monitor or visualize with the observing tools.
## Build an observing environment
@@ -23,7 +23,7 @@ The recommended observability environment consists of the following:
- Jaeger Operator and Jaeger
- Prometheus Operator and Prometheus
- Grafana
-- OpenTelemetry Operator and OpenTelemtry Collector
+- OpenTelemetry Operator and OpenTelemetry Collector
Vald provides [the default manifests](https://github.com/vdaas/vald/tree/main/k8s/metrics) and [the make commands](https://github.com/vdaas/vald/blob/main/Makefile.d/k8s.mk) for deploying those components.
Please refer to the following sections to deploy each component.
@@ -67,7 +67,7 @@ make k8s/metrics/grafana/deploy
### OpenTelemetry Operator and OpenTelemetry Collector
Vald uses OpenTelemetry Collector to get the telemetry data and export it to monitor backend components.
-The following command deploys OpenTelemtry Collector via OpenTelemerty Collector.
+The following command deploys OpenTelemetry Collector via OpenTelemetry Collector.
Before executing the following command, please ensure the Prometheus operator runs healthy.
diff --git a/docs/user-guides/upgrade-cluster.md b/docs/user-guides/upgrade-cluster.md
index 694a213213..41aa64f2e3 100644
--- a/docs/user-guides/upgrade-cluster.md
+++ b/docs/user-guides/upgrade-cluster.md
@@ -27,7 +27,7 @@ You can edit your `values.yaml` and update your Vald cluster by following steps:
```bash
helm upgrade vald/vald --values
- # e.g., helm upgrade vald vald/vald --values valeus.yaml
+ # e.g., helm upgrade vald vald/vald --values values.yaml
```
### Using vald-helm-operator
@@ -107,7 +107,7 @@ If there is major or minor upgrading, the chart structure may have changed.
```bash
helm upgrade vald/vald --values
- # e.g., helm upgrade vald vald/vald --values valeus.yaml
+ # e.g., helm upgrade vald vald/vald --values values.yaml
```
### Using vald-helm-operator
diff --git a/example/client/agent/main.go b/example/client/agent/main.go
index bddbb70677..77cf7eee48 100644
--- a/example/client/agent/main.go
+++ b/example/client/agent/main.go
@@ -44,10 +44,10 @@ var (
func init() {
/**
- Path option specifies hdf file by path. Default value is `fashion-mnist-784-euclidean.hdf5`.
- Addr option specifies grpc server address. Default value is `127.0.0.1:8080`.
- Wait option specifies indexing wait time (in seconds). Default value is `60`.
- **/
+ Path option specifies hdf file by path. Default value is `fashion-mnist-784-euclidean.hdf5`.
+ Addr option specifies grpc server address. Default value is `127.0.0.1:8080`.
+ Wait option specifies indexing wait time (in seconds). Default value is `60`.
+ **/
flag.StringVar(&datasetPath, "path", "fashion-mnist-784-euclidean.hdf5", "dataset path")
flag.StringVar(&grpcServerAddr, "addr", "127.0.0.1:8081", "gRPC server address")
flag.UintVar(&indexingWaitSeconds, "wait", 60, "indexing wait seconds")
@@ -56,9 +56,9 @@ func init() {
func main() {
/**
- Gets training data, test data and ids based on the dataset path.
- the number of ids is equal to that of training dataset.
- **/
+ Gets training data, test data and ids based on the dataset path.
+ the number of ids is equal to that of training dataset.
+ **/
ids, train, test, err := load(datasetPath)
if err != nil {
glg.Fatal(err)
@@ -98,10 +98,10 @@ func main() {
}
glg.Infof("Finish Inserting %d training vector to Vald Agent", insertCount)
/**
- Optional: Run Indexing instead of Auto Indexing
- If you run client.CreateAndSaveIndex, it costs less time for search
- When default_pool_size is not set, the below codes are required.
- **/
+ Optional: Run Indexing instead of Auto Indexing
+ If you run client.CreateAndSaveIndex, it costs less time for search
+ When default_pool_size is not set, the below codes are required.
+ **/
glg.Info("Start Indexing dataset.")
_, err = agent.NewAgentClient(conn).CreateAndSaveIndex(ctx, &payload.Control_CreateIndexRequest{
PoolSize: uint32(insertCount),
@@ -142,9 +142,9 @@ func main() {
glg.Info("Finish getting object")
/**
- Gets approximate vectors, which is based on the value of `SearchConfig`, from the indexed tree based on the training data.
- In this example, Vald Agent gets 10 approximate vectors each search vector.
- **/
+ Gets approximate vectors, which is based on the value of `SearchConfig`, from the indexed tree based on the training data.
+ In this example, Vald Agent gets 10 approximate vectors each search vector.
+ **/
glg.Infof("Start searching %d times", testCount)
for i, vec := range test[:testCount] {
// Send searching vector and configuration object to the Vald Agent server via gRPC.
@@ -188,11 +188,11 @@ func main() {
glg.Info("Finish removing vector")
glg.Info("Start removing indexed vector from backup")
/**
- Run Indexing instead of Auto Indexing.
- Before calling the SaveIndex (or CreateAndSaveIndex) API, the vectors you inserted before still exist in the NGT graph index even the Remove API is called due to the design of NGT.
- So at this moment, the neighbor vectors will be returned from the SearchByID API.
- To remove the vectors from the NGT graph completely, the SaveIndex API will be used here instead of waiting auto CreateIndex phase.
- **/
+ Run Indexing instead of Auto Indexing.
+ Before calling the SaveIndex (or CreateAndSaveIndex) API, the vectors you inserted before still exist in the NGT graph index even the Remove API is called due to the design of NGT.
+ So at this moment, the neighbor vectors will be returned from the SearchByID API.
+ To remove the vectors from the NGT graph completely, the SaveIndex API will be used here instead of waiting auto CreateIndex phase.
+ **/
_, err = agent.NewAgentClient(conn).SaveIndex(ctx, &payload.Empty{})
if err != nil {
glg.Fatal(err)
diff --git a/example/client/go.mod b/example/client/go.mod
index 2c9b6a8e7a..4736ad8483 100644
--- a/example/client/go.mod
+++ b/example/client/go.mod
@@ -1,21 +1,21 @@
module github.com/vdaas/vald/example/client
-go 1.22.3
+go 1.22.5
replace (
github.com/envoyproxy/protoc-gen-validate => github.com/envoyproxy/protoc-gen-validate v1.0.4
- github.com/goccy/go-json => github.com/goccy/go-json v0.10.2
+ github.com/goccy/go-json => github.com/goccy/go-json v0.10.3
github.com/golang/protobuf => github.com/golang/protobuf v1.5.4
github.com/kpango/glg => github.com/kpango/glg v1.6.15
github.com/pkg/sftp => github.com/pkg/sftp v1.13.6
- golang.org/x/crypto => golang.org/x/crypto v0.23.0
- golang.org/x/net => golang.org/x/net v0.25.0
- golang.org/x/text => golang.org/x/text v0.15.0
- google.golang.org/genproto => google.golang.org/genproto v0.0.0-20240506185236-b8a5c65736ae
- google.golang.org/genproto/googleapis/api => google.golang.org/genproto/googleapis/api v0.0.0-20240506185236-b8a5c65736ae
- google.golang.org/genproto/googleapis/rpc => google.golang.org/genproto/googleapis/rpc v0.0.0-20240506185236-b8a5c65736ae
- google.golang.org/grpc => google.golang.org/grpc v1.63.2
- google.golang.org/protobuf => google.golang.org/protobuf v1.34.1
+ golang.org/x/crypto => golang.org/x/crypto v0.25.0
+ golang.org/x/net => golang.org/x/net v0.27.0
+ golang.org/x/text => golang.org/x/text v0.16.0
+ google.golang.org/genproto => google.golang.org/genproto v0.0.0-20240723171418-e6d459c13d2a
+ google.golang.org/genproto/googleapis/api => google.golang.org/genproto/googleapis/api v0.0.0-20240723171418-e6d459c13d2a
+ google.golang.org/genproto/googleapis/rpc => google.golang.org/genproto/googleapis/rpc v0.0.0-20240723171418-e6d459c13d2a
+ google.golang.org/grpc => google.golang.org/grpc v1.65.0
+ google.golang.org/protobuf => google.golang.org/protobuf v1.34.2
gopkg.in/yaml.v2 => gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 => gopkg.in/yaml.v3 v3.0.1
)
@@ -25,7 +25,7 @@ require (
github.com/kpango/glg v1.6.14
github.com/vdaas/vald-client-go v1.7.12
gonum.org/v1/hdf5 v0.0.0-20210714002203-8c5d23bc6946
- google.golang.org/grpc v1.63.2
+ google.golang.org/grpc v1.64.1
)
require (
@@ -33,10 +33,10 @@ require (
github.com/goccy/go-json v0.10.2 // indirect
github.com/kpango/fastime v1.1.9 // indirect
github.com/planetscale/vtprotobuf v0.6.0 // indirect
- golang.org/x/net v0.21.0 // indirect
- golang.org/x/sys v0.20.0 // indirect
- golang.org/x/text v0.15.0 // indirect
- google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20240429193739-8cf5692501f6 // indirect
- google.golang.org/protobuf v1.34.1 // indirect
+ golang.org/x/net v0.26.0 // indirect
+ golang.org/x/sys v0.22.0 // indirect
+ golang.org/x/text v0.16.0 // indirect
+ google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240722135656-d784300faade // indirect
+ google.golang.org/protobuf v1.34.2 // indirect
)
diff --git a/example/client/go.mod.default b/example/client/go.mod.default
index eba3aefdcf..14c78eebdf 100644
--- a/example/client/go.mod.default
+++ b/example/client/go.mod.default
@@ -1,6 +1,6 @@
module github.com/vdaas/vald/example/client
-go 1.22.3
+go 1.22.5
replace (
github.com/envoyproxy/protoc-gen-validate => github.com/envoyproxy/protoc-gen-validate latest
diff --git a/example/client/go.sum b/example/client/go.sum
index c526bb0895..87c323dd58 100644
--- a/example/client/go.sum
+++ b/example/client/go.sum
@@ -1,7 +1,7 @@
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.32.0-20240221180331-f05a6f4403ce.1 h1:AmmAwHbvaeOIxDKG2+aTn5C36HjmFIMkrdTp49rp80Q=
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.32.0-20240221180331-f05a6f4403ce.1/go.mod h1:tiTMKD8j6Pd/D2WzREoweufjzaJKHZg35f/VGcZ2v3I=
-github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
-github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
+github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA=
+github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
@@ -24,20 +24,20 @@ go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60=
go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg=
-golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
-golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
-golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
-golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
-golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
+golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
+golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
+golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
+golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gonum.org/v1/hdf5 v0.0.0-20210714002203-8c5d23bc6946 h1:vJpL69PeUullhJyKtTjHjENEmZU3BkO4e+fod7nKzgM=
gonum.org/v1/hdf5 v0.0.0-20210714002203-8c5d23bc6946/go.mod h1:BQUWDHIAygjdt1HnUPQ0eWqLN2n5FwJycrpYUVUOx2I=
-google.golang.org/genproto/googleapis/api v0.0.0-20240506185236-b8a5c65736ae h1:AH34z6WAGVNkllnKs5raNq3yRq93VnjBG6rpfub/jYk=
-google.golang.org/genproto/googleapis/api v0.0.0-20240506185236-b8a5c65736ae/go.mod h1:FfiGhwUm6CJviekPrc0oJ+7h29e+DmWU6UtjX0ZvI7Y=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20240506185236-b8a5c65736ae h1:c55+MER4zkBS14uJhSZMGGmya0yJx5iHV4x/fpOSNRk=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20240506185236-b8a5c65736ae/go.mod h1:I7Y+G38R2bu5j1aLzfFmQfTcU/WnFuqDwLZAbvKTKpM=
-google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM=
-google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA=
-google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg=
-google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+google.golang.org/genproto/googleapis/api v0.0.0-20240723171418-e6d459c13d2a h1:YIa/rzVqMEokBkPtydCkx1VLmv3An1Uw7w1P1m6EhOY=
+google.golang.org/genproto/googleapis/api v0.0.0-20240723171418-e6d459c13d2a/go.mod h1:AHT0dDg3SoMOgZGnZk29b5xTbPHMoEC8qthmBLJCpys=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240723171418-e6d459c13d2a h1:hqK4+jJZXCU4pW7jsAdGOVFIfLHQeV7LaizZKnZ84HI=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240723171418-e6d459c13d2a/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY=
+google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc=
+google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ=
+google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
+google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
diff --git a/example/client/main.go b/example/client/main.go
index b57c895c9d..c323a1e3ba 100644
--- a/example/client/main.go
+++ b/example/client/main.go
@@ -42,11 +42,11 @@ var (
func init() {
/**
- Path option specifies hdf file by path. Default value is `fashion-mnist-784-euclidean.hdf5`.
- Addr option specifies grpc server address. Default value is `127.0.0.1:8081`.
- Insert option specifies insert count. Default value is `400`.
- Wait option specifies indexing wait time (in seconds). Default value is `60`.
- **/
+ Path option specifies hdf file by path. Default value is `fashion-mnist-784-euclidean.hdf5`.
+ Addr option specifies grpc server address. Default value is `127.0.0.1:8081`.
+ Insert option specifies insert count. Default value is `400`.
+ Wait option specifies indexing wait time (in seconds). Default value is `60`.
+ **/
flag.StringVar(&datasetPath, "path", "fashion-mnist-784-euclidean.hdf5", "dataset path")
flag.StringVar(&grpcServerAddr, "addr", "localhost:8081", "gRPC server address")
flag.UintVar(&insertCount, "insert", 400, "insert count")
@@ -56,9 +56,9 @@ func init() {
func main() {
/**
- Gets training data, test data and ids based on the dataset path.
- the number of ids is equal to that of training dataset.
- **/
+ Gets training data, test data and ids based on the dataset path.
+ the number of ids is equal to that of training dataset.
+ **/
ids, train, test, err := load(datasetPath)
if err != nil {
glg.Fatal(err)
@@ -103,9 +103,9 @@ func main() {
time.Sleep(wt)
/**
- Gets approximate vectors, which is based on the value of `SearchConfig`, from the indexed tree based on the training data.
- In this example, Vald gets 10 approximate vectors each search vector.
- **/
+ Gets approximate vectors, which is based on the value of `SearchConfig`, from the indexed tree based on the training data.
+ In this example, Vald gets 10 approximate vectors each search vector.
+ **/
glg.Infof("Start searching %d times", testCount)
for i, vec := range test[:testCount] {
// Send searching vector and configuration object to the Vald server via gRPC.
diff --git a/example/client/mirror/main.go b/example/client/mirror/main.go
index 38d586ed64..8e8f4b074e 100644
--- a/example/client/mirror/main.go
+++ b/example/client/mirror/main.go
@@ -43,10 +43,10 @@ var (
func init() {
/**
- Path option specifies hdf file by path. Default value is `fashion-mnist-784-euclidean.hdf5`.
- Addr option specifies grpc server addresses. Default value is `127.0.0.1:8080`,`127.0.0.1:8081`,`127.0.0.1:8082`.
- Wait option specifies indexing wait time (in seconds). Default value is `60`.
- **/
+ Path option specifies hdf file by path. Default value is `fashion-mnist-784-euclidean.hdf5`.
+ Addr option specifies grpc server addresses. Default value is `127.0.0.1:8080`,`127.0.0.1:8081`,`127.0.0.1:8082`.
+ Wait option specifies indexing wait time (in seconds). Default value is `60`.
+ **/
flag.StringVar(&datasetPath, "path", "fashion-mnist-784-euclidean.hdf5", "dataset path")
flag.StringVar(&grpcServerAddr, "addrs", "localhost:8080,localhost:8081,localhost:8082", "gRPC server addresses")
flag.UintVar(&indexingWaitSeconds, "wait", 60, "indexing wait seconds")
@@ -56,9 +56,9 @@ func init() {
func main() {
/**
- Gets training data, test data and ids based on the dataset path.
- the number of ids is equal to that of training dataset.
- **/
+ Gets training data, test data and ids based on the dataset path.
+ the number of ids is equal to that of training dataset.
+ **/
ids, train, test, err := load(datasetPath)
if err != nil {
glg.Fatal(err)
@@ -107,9 +107,9 @@ func main() {
time.Sleep(wt)
/**
- Gets approximate vectors, which is based on the value of `SearchConfig`, from the indexed tree based on the training data.
- In this example, Vald gets 10 approximate vectors each search vector.
- **/
+ Gets approximate vectors, which is based on the value of `SearchConfig`, from the indexed tree based on the training data.
+ In this example, Vald gets 10 approximate vectors each search vector.
+ **/
glg.Infof("Start searching %d times", testCount)
for i, vec := range test[:testCount] {
for j, client := range clients {
@@ -137,8 +137,8 @@ func main() {
glg.Infof("Finish searching %d times", testCount)
/**
- Gets the vector using inserted vector id from Vald cluster.
- **/
+ Gets the vector using inserted vector id from Vald cluster.
+ **/
glg.Infof("Start getting %d times", insertCount)
for i, id := range ids[:insertCount] {
for j, client := range clients {
diff --git a/github_info.json b/github_info.json
new file mode 100644
index 0000000000..dea04dd45d
--- /dev/null
+++ b/github_info.json
@@ -0,0 +1,192 @@
+{
+ "body": "\r\n\r\n### Description\r\nThe following modifications have been made to this PR.\r\n- Refactoring of IndexManager\r\n - Integration of Index proto into Vald proto\r\n - IndexInfo, IndexDetail, and GetTimestamp APIs are now available outside of Index manager\r\n- Automatic Dockerfile generation\r\n - https://github.com/vdaas/vald/blob/refactor/manager-index/small-refactor/hack/docker/gen/main.go\r\n- Fixes to Typo\r\n- Expose IndexDetail API\r\n- Ingress Route optimization\r\n - Added pass-through to LB when using MirrorGateway or FilterGateway as specific API processing is not needed\r\n- Add Formatter (crlfmt)\r\n - https://github.com/cockroachdb/crlfmt\r\n- Detailing of internal info API\r\n - Add GoMaxProcs, CGOCall, GoroutineCount, RuntimeCPUCores\r\n\r\nTranslated with DeepL.com (free version)\r\n\r\n### Related Issue\r\n\r\n\r\n\r\n\r\n\r\n\r\n### Versions\r\n\r\n\r\n\r\n- Go Version: 1.22.5\r\n- Rust Version: 1.77.2\r\n- Docker Version: 20.10.8\r\n- Kubernetes Version: v1.30.2\r\n- NGT Version: 2.2.2\r\n\r\n### Checklist\r\n\r\n\r\n\r\n\r\n- [ ] I have read the [CONTRIBUTING](https://github.com/vdaas/vald/blob/main/CONTRIBUTING.md) document and completed [our CLA agreement](https://cla-assistant.io/vdaas/vald).\r\n- [ ] I have checked open [Pull Requests](https://github.com/vdaas/vald/pulls) for the similar feature or fixes?\r\n\r\n### Special notes for your reviewer\r\n\r\n\r\n",
+ "headRefName": "refactor/manager-index/small-refactor",
+ "headRefOid": "6ad94c0afcf9152801412ea22aef8bb6178ebb3d",
+ "labels": [
+ {
+ "id": "MDU6TGFiZWwxNzI5NDQ2Mjg4",
+ "name": "team/core",
+ "description": "Core team",
+ "color": "fbca04"
+ },
+ {
+ "id": "MDU6TGFiZWwxNzI5NDQ5MTc4",
+ "name": "type/feature",
+ "description": "New feature",
+ "color": "1fa874"
+ },
+ {
+ "id": "MDU6TGFiZWwxNzI5NTgxMzcy",
+ "name": "priority/high",
+ "description": "",
+ "color": "5319e7"
+ },
+ {
+ "id": "MDU6TGFiZWwxNzI5NTgyMjA2",
+ "name": "type/refactoring",
+ "description": "",
+ "color": "055e5e"
+ },
+ {
+ "id": "MDU6TGFiZWwxNzI5NTgyODUz",
+ "name": "status/in-review",
+ "description": "",
+ "color": "defca6"
+ },
+ {
+ "id": "MDU6TGFiZWwxNzI5NTg3Njk5",
+ "name": "area/agent",
+ "description": "",
+ "color": "5c099b"
+ },
+ {
+ "id": "MDU6TGFiZWwxNzI5NTg3OTMy",
+ "name": "area/discoverer",
+ "description": "",
+ "color": "abc3fc"
+ },
+ {
+ "id": "MDU6TGFiZWwxNzI5NTg5OTA5",
+ "name": "area/manager/index",
+ "description": "",
+ "color": "6d7dc6"
+ },
+ {
+ "id": "MDU6TGFiZWwxNzI5NTkwMzYx",
+ "name": "area/filter/ingress",
+ "description": "",
+ "color": "dd6761"
+ },
+ {
+ "id": "MDU6TGFiZWwxNzI5NTkwNTEz",
+ "name": "area/filter/egress",
+ "description": "",
+ "color": "e04c96"
+ },
+ {
+ "id": "MDU6TGFiZWwxNzI5NTkwODA0",
+ "name": "area/internal",
+ "description": "",
+ "color": "d86586"
+ },
+ {
+ "id": "MDU6TGFiZWwxNzI5NTkxODE3",
+ "name": "type/ci",
+ "description": "",
+ "color": "006b75"
+ },
+ {
+ "id": "MDU6TGFiZWwxNzQ5MTMzNDMy",
+ "name": "size/XXXL",
+ "description": "",
+ "color": "d37054"
+ },
+ {
+ "id": "MDU6TGFiZWwxODM3NjQ2MjQw",
+ "name": "area/helm",
+ "description": "",
+ "color": "bfd4f2"
+ },
+ {
+ "id": "MDU6TGFiZWwxOTA2MDk1OTkz",
+ "name": "area/makefile",
+ "description": "",
+ "color": "c379e0"
+ },
+ {
+ "id": "MDU6TGFiZWwyMDg2NDk2MDI3",
+ "name": "area/agent/core",
+ "description": "",
+ "color": "ba400d"
+ },
+ {
+ "id": "MDU6TGFiZWwyMDg2NDk2MDI5",
+ "name": "area/agent/sidecar",
+ "description": "",
+ "color": "8befc0"
+ },
+ {
+ "id": "MDU6TGFiZWwyMTIyNzQyODI5",
+ "name": "area/tools/cli/loadtest",
+ "description": "",
+ "color": "99b2f7"
+ },
+ {
+ "id": "MDU6TGFiZWwyMjQ5MDg2Mjc2",
+ "name": "area/gateway/lb",
+ "description": "",
+ "color": "ededed"
+ },
+ {
+ "id": "MDU6TGFiZWwyMjQ5MDg2Mjc5",
+ "name": "area/gateway/filter",
+ "description": "",
+ "color": "ededed"
+ },
+ {
+ "id": "MDU6TGFiZWwyNDk0MTI0ODE5",
+ "name": "actions/e2e-deploy",
+ "description": "",
+ "color": "ededed"
+ },
+ {
+ "id": "MDU6TGFiZWwyNTExODU3NzM3",
+ "name": "actions/fossa",
+ "description": "",
+ "color": "ededed"
+ },
+ {
+ "id": "MDU6TGFiZWwyNjAxOTYyNTQ5",
+ "name": "actions/e2e-chaos",
+ "description": "",
+ "color": "ededed"
+ },
+ {
+ "id": "MDU6TGFiZWwzMjAwNTA4ODg5",
+ "name": "actions/e2e-profiling",
+ "description": "",
+ "color": "ededed"
+ },
+ {
+ "id": "LA_kwDOC6jpA872fNxB",
+ "name": "actions/e2e-max-dim",
+ "description": "",
+ "color": "ededed"
+ },
+ {
+ "id": "LA_kwDOC6jpA88AAAABJP5xbA",
+ "name": "ci/approved",
+ "description": "",
+ "color": "0E8A16"
+ },
+ {
+ "id": "LA_kwDOC6jpA88AAAABefFjpw",
+ "name": "actions/backport/release/v1.7",
+ "description": "",
+ "color": "fef2c0"
+ },
+ {
+ "id": "LA_kwDOC6jpA88AAAABgwMFlA",
+ "name": "area/agent/core/faiss",
+ "description": "",
+ "color": "ededed"
+ },
+ {
+ "id": "LA_kwDOC6jpA88AAAABgwMFlQ",
+ "name": "area/agent/core/ngt",
+ "description": "",
+ "color": "ededed"
+ },
+ {
+ "id": "LA_kwDOC6jpA88AAAABgwMFlg",
+ "name": "area/gateway/mirror",
+ "description": "",
+ "color": "ededed"
+ }
+ ],
+ "mergeCommit": {
+ "oid": "76eb8d7b596e611078a6b53351daf444ee401756"
+ },
+ "number": 2525,
+ "title": "refactor index manager service add index service API to expose index informations"
+}
diff --git a/go.mod b/go.mod
index 92a8a9826a..417bcf42fa 100644
--- a/go.mod
+++ b/go.mod
@@ -1,76 +1,76 @@
module github.com/vdaas/vald
-go 1.22.3
+go 1.22.5
replace (
- cloud.google.com/go => cloud.google.com/go v0.112.2
- cloud.google.com/go/bigquery => cloud.google.com/go/bigquery v1.61.0
- cloud.google.com/go/compute => cloud.google.com/go/compute v1.26.0
- cloud.google.com/go/datastore => cloud.google.com/go/datastore v1.16.0
+ cloud.google.com/go => cloud.google.com/go v0.115.0
+ cloud.google.com/go/bigquery => cloud.google.com/go/bigquery v1.62.0
+ cloud.google.com/go/compute => cloud.google.com/go/compute v1.27.3
+ cloud.google.com/go/datastore => cloud.google.com/go/datastore v1.17.1
cloud.google.com/go/firestore => cloud.google.com/go/firestore v1.15.0
- cloud.google.com/go/iam => cloud.google.com/go/iam v1.1.8
- cloud.google.com/go/kms => cloud.google.com/go/kms v1.15.9
- cloud.google.com/go/monitoring => cloud.google.com/go/monitoring v1.19.0
- cloud.google.com/go/pubsub => cloud.google.com/go/pubsub v1.38.0
- cloud.google.com/go/secretmanager => cloud.google.com/go/secretmanager v1.13.0
- cloud.google.com/go/storage => cloud.google.com/go/storage v1.40.0
- cloud.google.com/go/trace => cloud.google.com/go/trace v1.10.7
- code.cloudfoundry.org/bytefmt => code.cloudfoundry.org/bytefmt v0.0.0-20240507165102-251b29179075
+ cloud.google.com/go/iam => cloud.google.com/go/iam v1.1.11
+ cloud.google.com/go/kms => cloud.google.com/go/kms v1.18.3
+ cloud.google.com/go/monitoring => cloud.google.com/go/monitoring v1.20.2
+ cloud.google.com/go/pubsub => cloud.google.com/go/pubsub v1.40.0
+ cloud.google.com/go/secretmanager => cloud.google.com/go/secretmanager v1.13.4
+ cloud.google.com/go/storage => cloud.google.com/go/storage v1.43.0
+ cloud.google.com/go/trace => cloud.google.com/go/trace v1.10.10
+ code.cloudfoundry.org/bytefmt => code.cloudfoundry.org/bytefmt v0.0.0-20240722180632-e94c220fe743
contrib.go.opencensus.io/exporter/aws => contrib.go.opencensus.io/exporter/aws v0.0.0-20230502192102-15967c811cec
contrib.go.opencensus.io/exporter/prometheus => contrib.go.opencensus.io/exporter/prometheus v0.4.2
contrib.go.opencensus.io/integrations/ocsql => contrib.go.opencensus.io/integrations/ocsql v0.1.7
git.sr.ht/~sbinet/gg => git.sr.ht/~sbinet/gg v0.5.0
github.com/Azure/azure-amqp-common-go/v3 => github.com/Azure/azure-amqp-common-go/v3 v3.2.3
github.com/Azure/azure-sdk-for-go => github.com/Azure/azure-sdk-for-go v68.0.0+incompatible
- github.com/Azure/azure-sdk-for-go/sdk/azcore => github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1
- github.com/Azure/azure-sdk-for-go/sdk/azidentity => github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2
- github.com/Azure/azure-sdk-for-go/sdk/internal => github.com/Azure/azure-sdk-for-go/sdk/internal v1.7.0
+ github.com/Azure/azure-sdk-for-go/sdk/azcore => github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0
+ github.com/Azure/azure-sdk-for-go/sdk/azidentity => github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0
+ github.com/Azure/azure-sdk-for-go/sdk/internal => github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0
github.com/Azure/go-amqp => github.com/Azure/go-amqp v1.0.5
- github.com/Azure/go-autorest => github.com/Azure/go-autorest v14.2.1-0.20240104002855-4c0e21ca2bbb+incompatible
- github.com/Azure/go-autorest/autorest => github.com/Azure/go-autorest/autorest v0.11.30-0.20240104002855-4c0e21ca2bbb
- github.com/Azure/go-autorest/autorest/adal => github.com/Azure/go-autorest/autorest/adal v0.9.23
- github.com/Azure/go-autorest/autorest/date => github.com/Azure/go-autorest/autorest/date v0.3.1-0.20240104002855-4c0e21ca2bbb
- github.com/Azure/go-autorest/autorest/mocks => github.com/Azure/go-autorest/autorest/mocks v0.4.3-0.20240104002855-4c0e21ca2bbb
- github.com/Azure/go-autorest/autorest/to => github.com/Azure/go-autorest/autorest/to v0.4.1-0.20240104002855-4c0e21ca2bbb
- github.com/Azure/go-autorest/logger => github.com/Azure/go-autorest/logger v0.2.2-0.20240104002855-4c0e21ca2bbb
- github.com/Azure/go-autorest/tracing => github.com/Azure/go-autorest/tracing v0.6.1-0.20240104002855-4c0e21ca2bbb
- github.com/BurntSushi/toml => github.com/BurntSushi/toml v1.3.2
+ github.com/Azure/go-autorest => github.com/Azure/go-autorest v14.2.1-0.20240530140449-f7ea664c9cff+incompatible
+ github.com/Azure/go-autorest/autorest => github.com/Azure/go-autorest/autorest v0.11.30-0.20240530140449-f7ea664c9cff
+ github.com/Azure/go-autorest/autorest/adal => github.com/Azure/go-autorest/autorest/adal v0.9.24
+ github.com/Azure/go-autorest/autorest/date => github.com/Azure/go-autorest/autorest/date v0.3.1-0.20240530140449-f7ea664c9cff
+ github.com/Azure/go-autorest/autorest/mocks => github.com/Azure/go-autorest/autorest/mocks v0.4.3-0.20240530140449-f7ea664c9cff
+ github.com/Azure/go-autorest/autorest/to => github.com/Azure/go-autorest/autorest/to v0.4.1-0.20240530140449-f7ea664c9cff
+ github.com/Azure/go-autorest/logger => github.com/Azure/go-autorest/logger v0.2.2-0.20240530140449-f7ea664c9cff
+ github.com/Azure/go-autorest/tracing => github.com/Azure/go-autorest/tracing v0.6.1-0.20240530140449-f7ea664c9cff
+ github.com/BurntSushi/toml => github.com/BurntSushi/toml v1.4.0
github.com/DATA-DOG/go-sqlmock => github.com/DATA-DOG/go-sqlmock v1.5.2
- github.com/GoogleCloudPlatform/cloudsql-proxy => github.com/GoogleCloudPlatform/cloudsql-proxy v1.35.1
+ github.com/GoogleCloudPlatform/cloudsql-proxy => github.com/GoogleCloudPlatform/cloudsql-proxy v1.36.0
github.com/Masterminds/semver/v3 => github.com/Masterminds/semver/v3 v3.2.1
- github.com/ajstarks/deck => github.com/ajstarks/deck v0.0.0-20240329135147-d1f085d9d01e
- github.com/ajstarks/deck/generate => github.com/ajstarks/deck/generate v0.0.0-20240329135147-d1f085d9d01e
+ github.com/ajstarks/deck => github.com/ajstarks/deck v0.0.0-20240717142941-38ed00367aa6
+ github.com/ajstarks/deck/generate => github.com/ajstarks/deck/generate v0.0.0-20240717142941-38ed00367aa6
github.com/ajstarks/svgo => github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b
github.com/akrylysov/pogreb => github.com/akrylysov/pogreb v0.10.2
github.com/antihax/optional => github.com/antihax/optional v1.0.0
github.com/armon/go-socks5 => github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5
- github.com/aws/aws-sdk-go => github.com/aws/aws-sdk-go v1.52.4
- github.com/aws/aws-sdk-go-v2 => github.com/aws/aws-sdk-go-v2 v1.26.1
- github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream => github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2
- github.com/aws/aws-sdk-go-v2/config => github.com/aws/aws-sdk-go-v2/config v1.27.11
- github.com/aws/aws-sdk-go-v2/credentials => github.com/aws/aws-sdk-go-v2/credentials v1.17.11
- github.com/aws/aws-sdk-go-v2/feature/ec2/imds => github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1
- github.com/aws/aws-sdk-go-v2/feature/s3/manager => github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.15
- github.com/aws/aws-sdk-go-v2/internal/configsources => github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5
- github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5
+ github.com/aws/aws-sdk-go => github.com/aws/aws-sdk-go v1.55.1
+ github.com/aws/aws-sdk-go-v2 => github.com/aws/aws-sdk-go-v2 v1.30.3
+ github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream => github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3
+ github.com/aws/aws-sdk-go-v2/config => github.com/aws/aws-sdk-go-v2/config v1.27.27
+ github.com/aws/aws-sdk-go-v2/credentials => github.com/aws/aws-sdk-go-v2/credentials v1.17.27
+ github.com/aws/aws-sdk-go-v2/feature/ec2/imds => github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11
+ github.com/aws/aws-sdk-go-v2/feature/s3/manager => github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.8
+ github.com/aws/aws-sdk-go-v2/internal/configsources => github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15
+ github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15
github.com/aws/aws-sdk-go-v2/internal/ini => github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0
- github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding => github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2
- github.com/aws/aws-sdk-go-v2/service/internal/checksum => github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.7
- github.com/aws/aws-sdk-go-v2/service/internal/presigned-url => github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7
- github.com/aws/aws-sdk-go-v2/service/internal/s3shared => github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.5
- github.com/aws/aws-sdk-go-v2/service/kms => github.com/aws/aws-sdk-go-v2/service/kms v1.31.0
- github.com/aws/aws-sdk-go-v2/service/s3 => github.com/aws/aws-sdk-go-v2/service/s3 v1.53.1
- github.com/aws/aws-sdk-go-v2/service/secretsmanager => github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.28.6
- github.com/aws/aws-sdk-go-v2/service/sns => github.com/aws/aws-sdk-go-v2/service/sns v1.29.4
- github.com/aws/aws-sdk-go-v2/service/sqs => github.com/aws/aws-sdk-go-v2/service/sqs v1.31.4
- github.com/aws/aws-sdk-go-v2/service/ssm => github.com/aws/aws-sdk-go-v2/service/ssm v1.50.0
- github.com/aws/aws-sdk-go-v2/service/sso => github.com/aws/aws-sdk-go-v2/service/sso v1.20.5
- github.com/aws/aws-sdk-go-v2/service/sts => github.com/aws/aws-sdk-go-v2/service/sts v1.28.6
- github.com/aws/smithy-go => github.com/aws/smithy-go v1.20.2
+ github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding => github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3
+ github.com/aws/aws-sdk-go-v2/service/internal/checksum => github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.17
+ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url => github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17
+ github.com/aws/aws-sdk-go-v2/service/internal/s3shared => github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.15
+ github.com/aws/aws-sdk-go-v2/service/kms => github.com/aws/aws-sdk-go-v2/service/kms v1.35.3
+ github.com/aws/aws-sdk-go-v2/service/s3 => github.com/aws/aws-sdk-go-v2/service/s3 v1.58.2
+ github.com/aws/aws-sdk-go-v2/service/secretsmanager => github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.32.4
+ github.com/aws/aws-sdk-go-v2/service/sns => github.com/aws/aws-sdk-go-v2/service/sns v1.31.3
+ github.com/aws/aws-sdk-go-v2/service/sqs => github.com/aws/aws-sdk-go-v2/service/sqs v1.34.3
+ github.com/aws/aws-sdk-go-v2/service/ssm => github.com/aws/aws-sdk-go-v2/service/ssm v1.52.3
+ github.com/aws/aws-sdk-go-v2/service/sso => github.com/aws/aws-sdk-go-v2/service/sso v1.22.4
+ github.com/aws/aws-sdk-go-v2/service/sts => github.com/aws/aws-sdk-go-v2/service/sts v1.30.3
+ github.com/aws/smithy-go => github.com/aws/smithy-go v1.20.3
github.com/benbjohnson/clock => github.com/benbjohnson/clock v1.3.5
github.com/beorn7/perks => github.com/beorn7/perks v1.0.1
github.com/bmizerany/assert => github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869
- github.com/boombuler/barcode => github.com/boombuler/barcode v1.0.1
+ github.com/boombuler/barcode => github.com/boombuler/barcode v1.0.2
github.com/buger/jsonparser => github.com/buger/jsonparser v1.1.1
github.com/cenkalti/backoff/v4 => github.com/cenkalti/backoff/v4 v4.3.0
github.com/census-instrumentation/opencensus-proto => github.com/census-instrumentation/opencensus-proto v0.4.1
@@ -79,7 +79,7 @@ replace (
github.com/chzyer/readline => github.com/chzyer/readline v1.5.1
github.com/chzyer/test => github.com/chzyer/test v1.0.0
github.com/cncf/udpa/go => github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe
- github.com/cncf/xds/go => github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b
+ github.com/cncf/xds/go => github.com/cncf/xds/go v0.0.0-20240723142845-024c85f92f20
github.com/cockroachdb/apd => github.com/cockroachdb/apd v1.1.0
github.com/coreos/go-systemd/v22 => github.com/coreos/go-systemd/v22 v22.5.0
github.com/cpuguy83/go-md2man/v2 => github.com/cpuguy83/go-md2man/v2 v2.0.4
@@ -91,7 +91,7 @@ replace (
github.com/dnaeon/go-vcr => github.com/dnaeon/go-vcr v1.2.0
github.com/docopt/docopt-go => github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815
github.com/dustin/go-humanize => github.com/dustin/go-humanize v1.0.1
- github.com/emicklei/go-restful/v3 => github.com/emicklei/go-restful/v3 v3.12.0
+ github.com/emicklei/go-restful/v3 => github.com/emicklei/go-restful/v3 v3.12.1
github.com/envoyproxy/go-control-plane => github.com/envoyproxy/go-control-plane v0.12.0
github.com/envoyproxy/protoc-gen-validate => github.com/envoyproxy/protoc-gen-validate v1.0.4
github.com/evanphx/json-patch => github.com/evanphx/json-patch v0.5.2
@@ -102,16 +102,16 @@ replace (
github.com/gin-contrib/sse => github.com/gin-contrib/sse v0.1.0
github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.10.0
github.com/go-errors/errors => github.com/go-errors/errors v1.5.1
- github.com/go-fonts/dejavu => github.com/go-fonts/dejavu v0.3.3
- github.com/go-fonts/latin-modern => github.com/go-fonts/latin-modern v0.3.2
- github.com/go-fonts/liberation => github.com/go-fonts/liberation v0.3.2
+ github.com/go-fonts/dejavu => github.com/go-fonts/dejavu v0.3.4
+ github.com/go-fonts/latin-modern => github.com/go-fonts/latin-modern v0.3.3
+ github.com/go-fonts/liberation => github.com/go-fonts/liberation v0.3.3
github.com/go-fonts/stix => github.com/go-fonts/stix v0.2.2
github.com/go-gl/gl => github.com/go-gl/gl v0.0.0-20231021071112-07e5d0ea2e71
github.com/go-gl/glfw/v3.3/glfw => github.com/go-gl/glfw/v3.3/glfw v0.0.0-20240506104042-037f3cc74f2a
github.com/go-kit/log => github.com/go-kit/log v0.2.1
- github.com/go-latex/latex => github.com/go-latex/latex v0.0.0-20231108140139-5c1ce85aa4ea
+ github.com/go-latex/latex => github.com/go-latex/latex v0.0.0-20240709081214-31cef3c7570e
github.com/go-logfmt/logfmt => github.com/go-logfmt/logfmt v0.6.0
- github.com/go-logr/logr => github.com/go-logr/logr v1.4.1
+ github.com/go-logr/logr => github.com/go-logr/logr v1.4.2
github.com/go-logr/stdr => github.com/go-logr/stdr v1.2.2
github.com/go-logr/zapr => github.com/go-logr/zapr v1.3.0
github.com/go-openapi/jsonpointer => github.com/go-openapi/jsonpointer v0.21.0
@@ -121,7 +121,7 @@ replace (
github.com/go-playground/assert/v2 => github.com/go-playground/assert/v2 v2.2.0
github.com/go-playground/locales => github.com/go-playground/locales v0.14.1
github.com/go-playground/universal-translator => github.com/go-playground/universal-translator v0.18.1
- github.com/go-playground/validator/v10 => github.com/go-playground/validator/v10 v10.20.0
+ github.com/go-playground/validator/v10 => github.com/go-playground/validator/v10 v10.22.0
github.com/go-redis/redis/v8 => github.com/go-redis/redis/v8 v8.11.5
github.com/go-sql-driver/mysql => github.com/go-sql-driver/mysql v1.8.1
github.com/go-task/slim-sprig => github.com/go-task/slim-sprig v2.20.0+incompatible
@@ -131,7 +131,7 @@ replace (
github.com/gobwas/httphead => github.com/gobwas/httphead v0.1.0
github.com/gobwas/pool => github.com/gobwas/pool v0.2.1
github.com/gobwas/ws => github.com/gobwas/ws v1.4.0
- github.com/goccy/go-json => github.com/goccy/go-json v0.10.2
+ github.com/goccy/go-json => github.com/goccy/go-json v0.10.3
github.com/gocql/gocql => github.com/gocql/gocql v1.6.0
github.com/gocraft/dbr/v2 => github.com/gocraft/dbr/v2 v2.7.6
github.com/godbus/dbus/v5 => github.com/godbus/dbus/v5 v5.1.0
@@ -141,7 +141,7 @@ replace (
github.com/golang-sql/civil => github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9
github.com/golang-sql/sqlexp => github.com/golang-sql/sqlexp v0.1.0
github.com/golang/freetype => github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
- github.com/golang/glog => github.com/golang/glog v1.2.1
+ github.com/golang/glog => github.com/golang/glog v1.2.2
github.com/golang/groupcache => github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
github.com/golang/mock => github.com/golang/mock v1.6.0
github.com/golang/protobuf => github.com/golang/protobuf v1.5.4
@@ -149,25 +149,26 @@ replace (
github.com/google/btree => github.com/google/btree v1.1.2
github.com/google/gnostic => github.com/google/gnostic v0.7.0
github.com/google/go-cmp => github.com/google/go-cmp v0.6.0
- github.com/google/go-replayers/grpcreplay => github.com/google/go-replayers/grpcreplay v1.1.0
+ github.com/google/go-replayers/grpcreplay => github.com/google/go-replayers/grpcreplay v1.3.0
github.com/google/go-replayers/httpreplay => github.com/google/go-replayers/httpreplay v1.2.0
github.com/google/gofuzz => github.com/google/gofuzz v1.2.0
github.com/google/martian => github.com/google/martian v2.1.0+incompatible
github.com/google/martian/v3 => github.com/google/martian/v3 v3.3.3
- github.com/google/pprof => github.com/google/pprof v0.0.0-20240507183855-6f11f98ebb1c
+ github.com/google/pprof => github.com/google/pprof v0.0.0-20240722153945-304e4f0156b8
github.com/google/shlex => github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/google/subcommands => github.com/google/subcommands v1.2.0
github.com/google/uuid => github.com/google/uuid v1.6.0
github.com/google/wire => github.com/google/wire v0.6.0
- github.com/googleapis/gax-go/v2 => github.com/googleapis/gax-go/v2 v2.12.4
+ github.com/googleapis/gax-go/v2 => github.com/googleapis/gax-go/v2 v2.13.0
github.com/gorilla/mux => github.com/gorilla/mux v1.8.1
- github.com/gorilla/websocket => github.com/gorilla/websocket v1.5.1
+ github.com/gorilla/websocket => github.com/gorilla/websocket v1.5.3
+ github.com/grafana/pyroscope-go/godeltaprof => github.com/grafana/pyroscope-go/godeltaprof v0.1.7
github.com/gregjones/httpcache => github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79
- github.com/grpc-ecosystem/grpc-gateway/v2 => github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1
+ github.com/grpc-ecosystem/grpc-gateway/v2 => github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0
github.com/hailocab/go-hostpool => github.com/kpango/go-hostpool v0.0.0-20210303030322-aab80263dcd0
github.com/hanwen/go-fuse/v2 => github.com/hanwen/go-fuse/v2 v2.5.1
github.com/hashicorp/go-uuid => github.com/hashicorp/go-uuid v1.0.3
- github.com/hashicorp/go-version => github.com/hashicorp/go-version v1.6.0
+ github.com/hashicorp/go-version => github.com/hashicorp/go-version v1.7.0
github.com/iancoleman/strcase => github.com/iancoleman/strcase v0.3.0
github.com/ianlancetaylor/demangle => github.com/ianlancetaylor/demangle v0.0.0-20240312041847-bd984b5ce465
github.com/inconshreveable/mousetrap => github.com/inconshreveable/mousetrap v1.1.0
@@ -177,11 +178,11 @@ replace (
github.com/jackc/pgmock => github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65
github.com/jackc/pgpassfile => github.com/jackc/pgpassfile v1.0.0
github.com/jackc/pgproto3/v2 => github.com/jackc/pgproto3/v2 v2.3.3
- github.com/jackc/pgservicefile => github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9
+ github.com/jackc/pgservicefile => github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761
github.com/jackc/pgtype => github.com/jackc/pgtype v1.14.3
github.com/jackc/pgx/v4 => github.com/jackc/pgx/v4 v4.18.3
github.com/jackc/puddle => github.com/jackc/puddle v1.3.0
- github.com/jessevdk/go-flags => github.com/jessevdk/go-flags v1.5.0
+ github.com/jessevdk/go-flags => github.com/jessevdk/go-flags v1.6.1
github.com/jmespath/go-jmespath => github.com/jmespath/go-jmespath v0.4.0
github.com/jmespath/go-jmespath/internal/testify => github.com/jmespath/go-jmespath/internal/testify v1.5.1
github.com/jmoiron/sqlx => github.com/jmoiron/sqlx v1.4.0
@@ -191,8 +192,8 @@ replace (
github.com/jstemmer/go-junit-report => github.com/jstemmer/go-junit-report v1.0.0
github.com/kisielk/errcheck => github.com/kisielk/errcheck v1.7.0
github.com/kisielk/gotool => github.com/kisielk/gotool v1.0.0
- github.com/klauspost/compress => github.com/klauspost/compress v1.17.9-0.20240412100233-8bd3916ec655
- github.com/klauspost/cpuid/v2 => github.com/klauspost/cpuid/v2 v2.2.7
+ github.com/klauspost/compress => github.com/klauspost/compress v1.17.10-0.20240719110028-cfab8bd586ec
+ github.com/klauspost/cpuid/v2 => github.com/klauspost/cpuid/v2 v2.2.8
github.com/kpango/fastime => github.com/kpango/fastime v1.1.9
github.com/kpango/fuid => github.com/kpango/fuid v0.0.0-20221203053508-503b5ad89aa1
github.com/kpango/gache/v2 => github.com/kpango/gache/v2 v2.0.9
@@ -213,8 +214,8 @@ replace (
github.com/mattn/go-sqlite3 => github.com/mattn/go-sqlite3 v1.14.22
github.com/matttproud/golang_protobuf_extensions => github.com/matttproud/golang_protobuf_extensions v1.0.4
github.com/mitchellh/colorstring => github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db
- github.com/moby/spdystream => github.com/moby/spdystream v0.2.0
- github.com/moby/sys/mountinfo => github.com/moby/sys/mountinfo v0.7.1
+ github.com/moby/spdystream => github.com/moby/spdystream v0.4.0
+ github.com/moby/sys/mountinfo => github.com/moby/sys/mountinfo v0.7.2
github.com/modern-go/concurrent => github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
github.com/modern-go/reflect2 => github.com/modern-go/reflect2 v1.0.2
github.com/modocache/gover => github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5
@@ -224,7 +225,7 @@ replace (
github.com/niemeyer/pretty => github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e
github.com/nxadm/tail => github.com/nxadm/tail v1.4.11
github.com/onsi/ginkgo => github.com/onsi/ginkgo v1.16.5
- github.com/onsi/ginkgo/v2 => github.com/onsi/ginkgo/v2 v2.17.3
+ github.com/onsi/ginkgo/v2 => github.com/onsi/ginkgo/v2 v2.19.0
github.com/onsi/gomega => github.com/onsi/gomega v1.33.1
github.com/peterbourgon/diskv => github.com/peterbourgon/diskv v2.0.1+incompatible
github.com/phpdave11/gofpdf => github.com/phpdave11/gofpdf v1.4.2
@@ -236,10 +237,10 @@ replace (
github.com/pkg/sftp => github.com/pkg/sftp v1.13.6
github.com/pmezard/go-difflib => github.com/pmezard/go-difflib v1.0.0
github.com/prashantv/gostub => github.com/prashantv/gostub v1.1.0
- github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.19.0
+ github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.19.1
github.com/prometheus/client_model => github.com/prometheus/client_model v0.6.1
- github.com/prometheus/common => github.com/prometheus/common v0.53.0
- github.com/prometheus/procfs => github.com/prometheus/procfs v0.14.0
+ github.com/prometheus/common => github.com/prometheus/common v0.55.0
+ github.com/prometheus/procfs => github.com/prometheus/procfs v0.15.1
github.com/prometheus/prometheus => github.com/prometheus/prometheus v1.99.0
github.com/quasilyte/go-ruleguard => github.com/quasilyte/go-ruleguard v0.4.2
github.com/quasilyte/go-ruleguard/dsl => github.com/quasilyte/go-ruleguard/dsl v0.3.22
@@ -248,7 +249,7 @@ replace (
github.com/rogpeppe/fastuuid => github.com/rogpeppe/fastuuid v1.2.0
github.com/rogpeppe/go-internal => github.com/rogpeppe/go-internal v1.12.0
github.com/rs/xid => github.com/rs/xid v1.5.0
- github.com/rs/zerolog => github.com/rs/zerolog v1.32.0
+ github.com/rs/zerolog => github.com/rs/zerolog v1.33.0
github.com/russross/blackfriday/v2 => github.com/russross/blackfriday/v2 v2.1.0
github.com/ruudk/golang-pdf417 => github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245
github.com/schollz/progressbar/v2 => github.com/schollz/progressbar/v2 v2.15.0
@@ -260,7 +261,7 @@ replace (
github.com/shurcooL/vfsgen => github.com/shurcooL/vfsgen v0.0.0-20230704071429-0000e147ea92
github.com/sirupsen/logrus => github.com/sirupsen/logrus v1.9.3
github.com/spf13/afero => github.com/spf13/afero v1.11.0
- github.com/spf13/cobra => github.com/spf13/cobra v1.8.0
+ github.com/spf13/cobra => github.com/spf13/cobra v1.8.1
github.com/spf13/pflag => github.com/spf13/pflag v1.0.5
github.com/stoewer/go-strcase => github.com/stoewer/go-strcase v1.3.0
github.com/stretchr/objx => github.com/stretchr/objx v0.5.2
@@ -274,53 +275,53 @@ replace (
github.com/zeebo/xxh3 => github.com/zeebo/xxh3 v1.0.2
go.etcd.io/bbolt => go.etcd.io/bbolt v1.3.10
go.opencensus.io => go.opencensus.io v0.24.0
- go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc => go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0
- go.opentelemetry.io/otel => go.opentelemetry.io/otel v1.26.0
+ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc => go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0
+ go.opentelemetry.io/otel => go.opentelemetry.io/otel v1.28.0
go.opentelemetry.io/otel/exporters/otlp/internal/retry => go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.17.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric => go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.43.0
- go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc => go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.26.0
- go.opentelemetry.io/otel/exporters/otlp/otlptrace => go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc => go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.26.0
- go.opentelemetry.io/otel/metric => go.opentelemetry.io/otel/metric v1.26.0
- go.opentelemetry.io/otel/sdk => go.opentelemetry.io/otel/sdk v1.26.0
- go.opentelemetry.io/otel/sdk/metric => go.opentelemetry.io/otel/sdk/metric v1.26.0
- go.opentelemetry.io/otel/trace => go.opentelemetry.io/otel/trace v1.26.0
- go.opentelemetry.io/proto/otlp => go.opentelemetry.io/proto/otlp v1.2.0
- go.starlark.net => go.starlark.net v0.0.0-20240507195648-35fe9f26b4bc
+ go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc => go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace => go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc => go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0
+ go.opentelemetry.io/otel/metric => go.opentelemetry.io/otel/metric v1.28.0
+ go.opentelemetry.io/otel/sdk => go.opentelemetry.io/otel/sdk v1.28.0
+ go.opentelemetry.io/otel/sdk/metric => go.opentelemetry.io/otel/sdk/metric v1.28.0
+ go.opentelemetry.io/otel/trace => go.opentelemetry.io/otel/trace v1.28.0
+ go.opentelemetry.io/proto/otlp => go.opentelemetry.io/proto/otlp v1.3.1
+ go.starlark.net => go.starlark.net v0.0.0-20240705175910-70002002b310
go.uber.org/atomic => go.uber.org/atomic v1.11.0
go.uber.org/automaxprocs => go.uber.org/automaxprocs v1.5.3
go.uber.org/goleak => go.uber.org/goleak v1.3.0
go.uber.org/multierr => go.uber.org/multierr v1.11.0
go.uber.org/zap => go.uber.org/zap v1.27.0
gocloud.dev => gocloud.dev v0.37.0
- golang.org/x/crypto => golang.org/x/crypto v0.23.0
- golang.org/x/exp => golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842
- golang.org/x/exp/typeparams => golang.org/x/exp/typeparams v0.0.0-20240506185415-9bf2ced13842
- golang.org/x/image => golang.org/x/image v0.16.0
+ golang.org/x/crypto => golang.org/x/crypto v0.25.0
+ golang.org/x/exp => golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56
+ golang.org/x/exp/typeparams => golang.org/x/exp/typeparams v0.0.0-20240719175910-8a7402abbf56
+ golang.org/x/image => golang.org/x/image v0.18.0
golang.org/x/lint => golang.org/x/lint v0.0.0-20210508222113-6edffad5e616
- golang.org/x/mobile => golang.org/x/mobile v0.0.0-20240506190922-a1a533f289d3
- golang.org/x/mod => golang.org/x/mod v0.17.0
- golang.org/x/net => golang.org/x/net v0.25.0
- golang.org/x/oauth2 => golang.org/x/oauth2 v0.20.0
+ golang.org/x/mobile => golang.org/x/mobile v0.0.0-20240716161057-1ad2df20a8b6
+ golang.org/x/mod => golang.org/x/mod v0.19.0
+ golang.org/x/net => golang.org/x/net v0.27.0
+ golang.org/x/oauth2 => golang.org/x/oauth2 v0.21.0
golang.org/x/sync => golang.org/x/sync v0.7.0
- golang.org/x/sys => golang.org/x/sys v0.20.0
- golang.org/x/term => golang.org/x/term v0.20.0
- golang.org/x/text => golang.org/x/text v0.15.0
+ golang.org/x/sys => golang.org/x/sys v0.22.0
+ golang.org/x/term => golang.org/x/term v0.22.0
+ golang.org/x/text => golang.org/x/text v0.16.0
golang.org/x/time => golang.org/x/time v0.5.0
- golang.org/x/tools => golang.org/x/tools v0.21.0
- golang.org/x/xerrors => golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028
+ golang.org/x/tools => golang.org/x/tools v0.23.0
+ golang.org/x/xerrors => golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9
gomodules.xyz/jsonpatch/v2 => gomodules.xyz/jsonpatch/v2 v2.4.0
gonum.org/v1/gonum => gonum.org/v1/gonum v0.15.0
gonum.org/v1/hdf5 => gonum.org/v1/hdf5 v0.0.0-20210714002203-8c5d23bc6946
gonum.org/v1/plot => gonum.org/v1/plot v0.14.0
- google.golang.org/api => google.golang.org/api v0.178.0
+ google.golang.org/api => google.golang.org/api v0.189.0
google.golang.org/appengine => google.golang.org/appengine v1.6.8
- google.golang.org/genproto => google.golang.org/genproto v0.0.0-20240506185236-b8a5c65736ae
- google.golang.org/genproto/googleapis/api => google.golang.org/genproto/googleapis/api v0.0.0-20240506185236-b8a5c65736ae
- google.golang.org/genproto/googleapis/rpc => google.golang.org/genproto/googleapis/rpc v0.0.0-20240506185236-b8a5c65736ae
- google.golang.org/grpc => google.golang.org/grpc v1.63.2
- google.golang.org/grpc/cmd/protoc-gen-go-grpc => google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0
- google.golang.org/protobuf => google.golang.org/protobuf v1.34.1
+ google.golang.org/genproto => google.golang.org/genproto v0.0.0-20240723171418-e6d459c13d2a
+ google.golang.org/genproto/googleapis/api => google.golang.org/genproto/googleapis/api v0.0.0-20240723171418-e6d459c13d2a
+ google.golang.org/genproto/googleapis/rpc => google.golang.org/genproto/googleapis/rpc v0.0.0-20240723171418-e6d459c13d2a
+ google.golang.org/grpc => google.golang.org/grpc v1.65.0
+ google.golang.org/grpc/cmd/protoc-gen-go-grpc => google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.4.0
+ google.golang.org/protobuf => google.golang.org/protobuf v1.34.2
gopkg.in/check.v1 => gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
gopkg.in/inconshreveable/log15.v2 => gopkg.in/inconshreveable/log15.v2 v2.16.0
gopkg.in/inf.v0 => gopkg.in/inf.v0 v0.9.1
@@ -328,19 +329,19 @@ replace (
gopkg.in/yaml.v2 => gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 => gopkg.in/yaml.v3 v3.0.1
honnef.co/go/tools => honnef.co/go/tools v0.4.7
- k8s.io/api => k8s.io/api v0.30.0
- k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.30.0
- k8s.io/apimachinery => k8s.io/apimachinery v0.30.0
- k8s.io/cli-runtime => k8s.io/cli-runtime v0.30.0
- k8s.io/client-go => k8s.io/client-go v0.30.0
- k8s.io/component-base => k8s.io/component-base v0.30.0
- k8s.io/klog/v2 => k8s.io/klog/v2 v2.120.1
- k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20240430033511-f0e62f92d13f
- k8s.io/kubernetes => k8s.io/kubernetes v0.30.0
- k8s.io/metrics => k8s.io/metrics v0.30.0
+ k8s.io/api => k8s.io/api v0.30.2
+ k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.30.2
+ k8s.io/apimachinery => k8s.io/apimachinery v0.30.2
+ k8s.io/cli-runtime => k8s.io/cli-runtime v0.30.2
+ k8s.io/client-go => k8s.io/client-go v0.30.2
+ k8s.io/component-base => k8s.io/component-base v0.30.2
+ k8s.io/klog/v2 => k8s.io/klog/v2 v2.130.1
+ k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20240709000822-3c01b740850f
+ k8s.io/kubernetes => k8s.io/kubernetes v0.30.2
+ k8s.io/metrics => k8s.io/metrics v0.30.2
nhooyr.io/websocket => nhooyr.io/websocket v1.8.11
rsc.io/pdf => rsc.io/pdf v0.1.1
- sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.18.2
+ sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.18.4
sigs.k8s.io/json => sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd
sigs.k8s.io/kustomize => sigs.k8s.io/kustomize v2.0.3+incompatible
sigs.k8s.io/structured-merge-diff/v4 => sigs.k8s.io/structured-merge-diff/v4 v4.4.1
@@ -348,8 +349,8 @@ replace (
)
require (
- buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.1-20240401165935-b983156c5e99.1
- cloud.google.com/go/storage v1.40.0
+ buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.2-20240717164558-a6c49f84cc0f.2
+ cloud.google.com/go/storage v1.42.0
code.cloudfoundry.org/bytefmt v0.0.0-20190710193110-1eb035ffe2b6
github.com/akrylysov/pogreb v0.0.0-00010101000000-000000000000
github.com/aws/aws-sdk-go v1.50.36
@@ -363,8 +364,9 @@ require (
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.6.0
github.com/gorilla/mux v0.0.0-00010101000000-000000000000
+ github.com/grafana/pyroscope-go/godeltaprof v0.0.0-00010101000000-000000000000
github.com/hashicorp/go-version v0.0.0-00010101000000-000000000000
- github.com/klauspost/compress v1.16.7
+ github.com/klauspost/compress v1.17.3
github.com/kpango/fastime v1.1.9
github.com/kpango/fuid v0.0.0-00010101000000-000000000000
github.com/kpango/gache/v2 v2.0.0-00010101000000-000000000000
@@ -381,49 +383,49 @@ require (
github.com/zeebo/xxh3 v1.0.2
go.etcd.io/bbolt v1.3.8
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0
- go.opentelemetry.io/otel v1.26.0
+ go.opentelemetry.io/otel v1.28.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.0.0-00010101000000-000000000000
- go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0
- go.opentelemetry.io/otel/metric v1.26.0
- go.opentelemetry.io/otel/sdk v1.26.0
- go.opentelemetry.io/otel/sdk/metric v1.26.0
- go.opentelemetry.io/otel/trace v1.26.0
+ go.opentelemetry.io/otel/metric v1.28.0
+ go.opentelemetry.io/otel/sdk v1.28.0
+ go.opentelemetry.io/otel/sdk/metric v1.28.0
+ go.opentelemetry.io/otel/trace v1.28.0
go.uber.org/automaxprocs v0.0.0-00010101000000-000000000000
go.uber.org/goleak v1.3.0
go.uber.org/ratelimit v0.3.1
go.uber.org/zap v1.27.0
gocloud.dev v0.0.0-00010101000000-000000000000
- golang.org/x/net v0.25.0
- golang.org/x/oauth2 v0.20.0
+ golang.org/x/net v0.27.0
+ golang.org/x/oauth2 v0.21.0
golang.org/x/sync v0.7.0
- golang.org/x/sys v0.20.0
- golang.org/x/text v0.15.0
+ golang.org/x/sys v0.22.0
+ golang.org/x/text v0.16.0
golang.org/x/time v0.5.0
- golang.org/x/tools v0.21.0
+ golang.org/x/tools v0.23.0
gonum.org/v1/hdf5 v0.0.0-00010101000000-000000000000
gonum.org/v1/plot v0.14.0
- google.golang.org/genproto/googleapis/api v0.0.0-20240429193739-8cf5692501f6
- google.golang.org/genproto/googleapis/rpc v0.0.0-20240429193739-8cf5692501f6
- google.golang.org/grpc v1.63.2
- google.golang.org/protobuf v1.34.1
+ google.golang.org/genproto/googleapis/api v0.0.0-20240722135656-d784300faade
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240722135656-d784300faade
+ google.golang.org/grpc v1.65.0
+ google.golang.org/protobuf v1.34.2
gopkg.in/yaml.v2 v2.4.0
- k8s.io/api v0.30.0
- k8s.io/apimachinery v0.30.0
+ k8s.io/api v0.30.2
+ k8s.io/apimachinery v0.30.2
k8s.io/cli-runtime v0.0.0-00010101000000-000000000000
- k8s.io/client-go v0.30.0
+ k8s.io/client-go v0.30.2
k8s.io/metrics v0.0.0-00010101000000-000000000000
- k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0
+ k8s.io/utils v0.0.0-20240711033017-18e509b52bc8
sigs.k8s.io/controller-runtime v0.0.0-00010101000000-000000000000
sigs.k8s.io/yaml v1.3.0
)
require (
- cloud.google.com/go v0.112.2 // indirect
- cloud.google.com/go/auth v0.3.0 // indirect
- cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect
- cloud.google.com/go/compute/metadata v0.3.0 // indirect
- cloud.google.com/go/iam v1.1.8 // indirect
+ cloud.google.com/go v0.115.0 // indirect
+ cloud.google.com/go/auth v0.7.2 // indirect
+ cloud.google.com/go/auth/oauth2adapt v0.2.3 // indirect
+ cloud.google.com/go/compute/metadata v0.5.0 // indirect
+ cloud.google.com/go/iam v1.1.11 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
git.sr.ht/~sbinet/gg v0.5.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
@@ -432,7 +434,7 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/campoy/embedmd v1.0.0 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
- github.com/cespare/xxhash/v2 v2.2.0 // indirect
+ github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
@@ -440,9 +442,9 @@ require (
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-errors/errors v1.4.2 // indirect
- github.com/go-fonts/liberation v0.3.2 // indirect
+ github.com/go-fonts/liberation v0.3.3 // indirect
github.com/go-latex/latex v0.0.0-20231108140139-5c1ce85aa4ea // indirect
- github.com/go-logr/logr v1.4.1 // indirect
+ github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
@@ -459,15 +461,15 @@ require (
github.com/google/btree v1.0.1 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/gofuzz v1.2.0 // indirect
- github.com/google/pprof v0.0.0-20240430035430-e4905b036c4e // indirect
+ github.com/google/pprof v0.0.0-20240722153945-304e4f0156b8 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/wire v0.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
- github.com/googleapis/gax-go/v2 v2.12.4 // indirect
+ github.com/googleapis/gax-go/v2 v2.12.5 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect
- github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 // indirect
+ github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
@@ -487,10 +489,10 @@ require (
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
- github.com/prometheus/client_golang v1.19.0 // indirect
- github.com/prometheus/client_model v0.6.0 // indirect
+ github.com/prometheus/client_golang v1.19.1 // indirect
+ github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.48.0 // indirect
- github.com/prometheus/procfs v0.12.0 // indirect
+ github.com/prometheus/procfs v0.15.1 // indirect
github.com/quasilyte/gogrep v0.5.0 // indirect
github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect
github.com/scylladb/go-reflectx v1.0.1 // indirect
@@ -500,22 +502,22 @@ require (
github.com/xlab/treeprint v1.2.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
- go.opentelemetry.io/proto/otlp v1.2.0 // indirect
+ go.opentelemetry.io/proto/otlp v1.3.1 // indirect
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
go.uber.org/multierr v1.11.0 // indirect
- golang.org/x/crypto v0.23.0 // indirect
+ golang.org/x/crypto v0.25.0 // indirect
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
golang.org/x/exp/typeparams v0.0.0-20240213143201-ec583247a57a // indirect
- golang.org/x/image v0.16.0 // indirect
- golang.org/x/mod v0.17.0 // indirect
- golang.org/x/term v0.20.0 // indirect
+ golang.org/x/image v0.18.0 // indirect
+ golang.org/x/mod v0.19.0 // indirect
+ golang.org/x/term v0.22.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
- google.golang.org/api v0.177.0 // indirect
- google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda // indirect
+ google.golang.org/api v0.188.0 // indirect
+ google.golang.org/genproto v0.0.0-20240722135656-d784300faade // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
- k8s.io/apiextensions-apiserver v0.30.0 // indirect
+ k8s.io/apiextensions-apiserver v0.30.1 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
diff --git a/go.sum b/go.sum
index 268541e1d4..edb0e952d8 100644
--- a/go.sum
+++ b/go.sum
@@ -1,149 +1,156 @@
-buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.1-20240401165935-b983156c5e99.1 h1:npqzxtoNbSdWs7XBDzqvqA1ANrQQGc8QpN0zFq9sVHA=
-buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.1-20240401165935-b983156c5e99.1/go.mod h1:XF+P8+RmfdufmIYpGUC+6bF7S+IlmHDEnCrO3OXaUAQ=
+buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.2-20240717164558-a6c49f84cc0f.2 h1:SZRVx928rbYZ6hEKUIN+vtGDkl7uotABRWGY4OAg5gM=
+buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.2-20240717164558-a6c49f84cc0f.2/go.mod h1:ylS4c28ACSI59oJrOdW4pHS4n0Hw4TgSPHn8rpHl4Yw=
cel.dev/expr v0.15.0 h1:O1jzfJCQBfL5BFoYktaxwIhuttaQPsVWerH9/EEKx0w=
cel.dev/expr v0.15.0/go.mod h1:TRSuuV7DlVCE/uwv5QbAiW/v8l5O8C4eEPHeu7gf7Sg=
-cloud.google.com/go v0.112.2 h1:ZaGT6LiG7dBzi6zNOvVZwacaXlmf3lRqnC4DQzqyRQw=
-cloud.google.com/go v0.112.2/go.mod h1:iEqjp//KquGIJV/m+Pk3xecgKNhV+ry+vVTsy4TbDms=
-cloud.google.com/go/accessapproval v1.7.7/go.mod h1:10ZDPYiTm8tgxuMPid8s2DL93BfCt6xBh/Vg0Xd8pU0=
-cloud.google.com/go/accesscontextmanager v1.8.6/go.mod h1:rMC0Z8pCe/JR6yQSksprDc6swNKjMEvkfCbaesh+OS0=
-cloud.google.com/go/accesscontextmanager v1.8.7/go.mod h1:jSvChL1NBQ+uLY9zUBdPy9VIlozPoHptdBnRYeWuQoM=
-cloud.google.com/go/aiplatform v1.67.0/go.mod h1:s/sJ6btBEr6bKnrNWdK9ZgHCvwbZNdP90b3DDtxxw+Y=
-cloud.google.com/go/analytics v0.23.2/go.mod h1:vtE3olAXZ6edJYk1UOndEs6EfaEc9T2B28Y4G5/a7Fo=
-cloud.google.com/go/apigateway v1.6.7/go.mod h1:7wAMb/33Rzln+PrGK16GbGOfA1zAO5Pq6wp19jtIt7c=
-cloud.google.com/go/apigeeconnect v1.6.7/go.mod h1:hZxCKvAvDdKX8+eT0g5eEAbRSS9Gkzi+MPWbgAMAy5U=
-cloud.google.com/go/apigeeregistry v0.8.5/go.mod h1:ZMg60hq2K35tlqZ1VVywb9yjFzk9AJ7zqxrysOxLi3o=
-cloud.google.com/go/appengine v1.8.7/go.mod h1:1Fwg2+QTgkmN6Y+ALGwV8INLbdkI7+vIvhcKPZCML0g=
-cloud.google.com/go/area120 v0.8.7/go.mod h1:L/xTq4NLP9mmxiGdcsVz7y1JLc9DI8pfaXRXbnjkR6w=
-cloud.google.com/go/artifactregistry v1.14.9/go.mod h1:n2OsUqbYoUI2KxpzQZumm6TtBgtRf++QulEohdnlsvI=
-cloud.google.com/go/asset v1.19.1/go.mod h1:kGOS8DiCXv6wU/JWmHWCgaErtSZ6uN5noCy0YwVaGfs=
-cloud.google.com/go/assuredworkloads v1.11.7/go.mod h1:CqXcRH9N0KCDtHhFisv7kk+cl//lyV+pYXGi1h8rCEU=
+cloud.google.com/go v0.115.0 h1:CnFSK6Xo3lDYRoBKEcAtia6VSC837/ZkJuRduSFnr14=
+cloud.google.com/go v0.115.0/go.mod h1:8jIM5vVgoAEoiVxQ/O4BFTfHqulPZgs/ufEzMcFMdWU=
+cloud.google.com/go/accessapproval v1.7.10/go.mod h1:iOXZj2B/c3N8nf2PYOB3iuRKCbnkn19/F6fqaa2zhn8=
+cloud.google.com/go/accesscontextmanager v1.8.9/go.mod h1:IXvQesVgOC7aXgK9OpYFn5eWnzz8fazegIiJ5WnCOVw=
+cloud.google.com/go/accesscontextmanager v1.8.10/go.mod h1:hdwcvyIn3NXgjSiUanbL7drFlOl39rAoj5SKBrNVtyA=
+cloud.google.com/go/aiplatform v1.68.0/go.mod h1:105MFA3svHjC3Oazl7yjXAmIR89LKhRAeNdnDKJczME=
+cloud.google.com/go/analytics v0.23.5/go.mod h1:J54PE6xjbmbTA5mOOfX5ibafOs9jyY7sFKTTiAnIIY4=
+cloud.google.com/go/apigateway v1.6.10/go.mod h1:3bRZnd+TDYONxRw2W8LB1jG3pDONS7GHJXMm5+BtQ+k=
+cloud.google.com/go/apigeeconnect v1.6.10/go.mod h1:MZf8FZK+0JZBcncSSnUkzWw2n2fQnEdIvfI6J7hGcEY=
+cloud.google.com/go/apigeeregistry v0.8.8/go.mod h1:0pDUUsNGiqCuBlD0VoPX2ssug6/vJ6BBPg8o4qPkE4k=
+cloud.google.com/go/appengine v1.8.10/go.mod h1:4jh9kPp01PeN//i+yEHjIQ5153f/F9q/CDbNTMYBlU4=
+cloud.google.com/go/area120 v0.8.10/go.mod h1:vTEko4eg1VkkkEzWDjLtMwBHgm7L4x8HgWE8fgEUd5k=
+cloud.google.com/go/artifactregistry v1.14.12/go.mod h1:00qcBxCdu0SKIYPhFOymrsJpdacjBHVSiCsRkyqlRUA=
+cloud.google.com/go/asset v1.19.4/go.mod h1:zSEhgb9eNLeBcl4eSO/nsrh1MyUNCBynvyRaFnXMaeY=
+cloud.google.com/go/assuredworkloads v1.11.10/go.mod h1:x6pCPBbTVjXbAWu35spKLY3AU4Pmcn4GeXnkZGxOVhU=
cloud.google.com/go/auth v0.2.1/go.mod h1:khQRBNrvNoHiHhV1iu2x8fSnlNbCaVHilznW5MAI5GY=
-cloud.google.com/go/auth v0.2.2/go.mod h1:2bDNJWtWziDT3Pu1URxHHbkHE/BbOCuyUiKIGcNvafo=
-cloud.google.com/go/auth v0.3.0 h1:PRyzEpGfx/Z9e8+lHsbkoUVXD0gnu4MNmm7Gp8TQNIs=
cloud.google.com/go/auth v0.3.0/go.mod h1:lBv6NKTWp8E3LPzmO1TbiiRKc4drLOfHsgmlH9ogv5w=
-cloud.google.com/go/auth/oauth2adapt v0.2.1/go.mod h1:tOdK/k+D2e4GEwfBRA48dKNQiDsqIXxLh7VU319eV0g=
-cloud.google.com/go/auth/oauth2adapt v0.2.2 h1:+TTV8aXpjeChS9M+aTtN/TjdQnzJvmzKFt//oWu7HX4=
+cloud.google.com/go/auth v0.4.1/go.mod h1:QVBuVEKpCn4Zp58hzRGvL0tjRGU0YqdRTdCHM1IHnro=
+cloud.google.com/go/auth v0.4.2/go.mod h1:Kqvlz1cf1sNA0D+sYJnkPQOP+JMHkuHeIgVmCRtZOLc=
+cloud.google.com/go/auth v0.5.1/go.mod h1:vbZT8GjzDf3AVqCcQmqeeM32U9HBFc32vVVAbwDsa6s=
+cloud.google.com/go/auth v0.6.0/go.mod h1:b4acV+jLQDyjwm4OXHYjNvRi4jvGBzHWJRtJcy+2P4g=
+cloud.google.com/go/auth v0.6.1/go.mod h1:eFHG7zDzbXHKmjJddFG/rBlcGp6t25SwRUiEQSlO4x4=
+cloud.google.com/go/auth v0.7.0/go.mod h1:D+WqdrpcjmiCgWrXmLLxOVq1GACoE36chW6KXoEvuIw=
+cloud.google.com/go/auth v0.7.2 h1:uiha352VrCDMXg+yoBtaD0tUF4Kv9vrtrWPYXwutnDE=
+cloud.google.com/go/auth v0.7.2/go.mod h1:VEc4p5NNxycWQTMQEDQF0bd6aTMb6VgYDXEwiJJQAbs=
cloud.google.com/go/auth/oauth2adapt v0.2.2/go.mod h1:wcYjgpZI9+Yu7LyYBg4pqSiaRkfEK3GQcpb7C/uyF1Q=
-cloud.google.com/go/automl v1.13.7/go.mod h1:E+s0VOsYXUdXpq0y4gNZpi0A/s6y9+lAarmV5Eqlg40=
-cloud.google.com/go/baremetalsolution v1.2.6/go.mod h1:KkS2BtYXC7YGbr42067nzFr+ABFMs6cxEcA1F+cedIw=
-cloud.google.com/go/batch v1.8.5/go.mod h1:YSWU2RTIeoHWVwieZJDTLEfWWUsuk10uhAr5K1dTMiw=
-cloud.google.com/go/beyondcorp v1.0.6/go.mod h1:wRkenqrVRtnGFfnyvIg0zBFUdN2jIfeojFF9JJDwVIA=
-cloud.google.com/go/bigquery v1.61.0/go.mod h1:PjZUje0IocbuTOdq4DBOJLNYB0WF3pAKBHzAYyxCwFo=
-cloud.google.com/go/billing v1.18.5/go.mod h1:lHw7fxS6p7hLWEPzdIolMtOd0ahLwlokW06BzbleKP8=
-cloud.google.com/go/binaryauthorization v1.8.3/go.mod h1:Cul4SsGlbzEsWPOz2sH8m+g2Xergb6ikspUyQ7iOThE=
-cloud.google.com/go/certificatemanager v1.8.1/go.mod h1:hDQzr50Vx2gDB+dOfmDSsQzJy/UPrYRdzBdJ5gAVFIc=
-cloud.google.com/go/channel v1.17.7/go.mod h1:b+FkgBrhMKM3GOqKUvqHFY/vwgp+rwsAuaMd54wCdN4=
-cloud.google.com/go/cloudbuild v1.16.1/go.mod h1:c2KUANTtCBD8AsRavpPout6Vx8W+fsn5zTsWxCpWgq4=
-cloud.google.com/go/clouddms v1.7.6/go.mod h1:8HWZ2tznZ0mNAtTpfnRNT0QOThqn9MBUqTj0Lx8npIs=
-cloud.google.com/go/cloudtasks v1.12.8/go.mod h1:aX8qWCtmVf4H4SDYUbeZth9C0n9dBj4dwiTYi4Or/P4=
-cloud.google.com/go/compute v1.26.0/go.mod h1:T9RIRap4pVHCGUkVFRJ9hygT3KCXjip41X1GgWtBBII=
-cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM=
+cloud.google.com/go/auth/oauth2adapt v0.2.3 h1:MlxF+Pd3OmSudg/b1yZ5lJwoXCEaeedAguodky1PcKI=
+cloud.google.com/go/auth/oauth2adapt v0.2.3/go.mod h1:tMQXOfZzFuNuUxOypHlQEXgdfX5cuhwU+ffUuXRJE8I=
+cloud.google.com/go/automl v1.13.10/go.mod h1:I5nlZ4sBYIX90aBwv3mm5A0W6tlGbzrJ4nkaErdsmAk=
+cloud.google.com/go/baremetalsolution v1.2.9/go.mod h1:eFlsoR4Im039D+EVn1fKXEKWNPoMW2ewXBTHmjEZxlM=
+cloud.google.com/go/batch v1.9.1/go.mod h1:UGOBIGCUNo9NPeJ4VvmGpnTbE8vTewNhFaI/ZcQZaHk=
+cloud.google.com/go/beyondcorp v1.0.9/go.mod h1:xa0eU8tIbYVraMOpRh5V9PirdYROvTUcPayJW9UlSNs=
+cloud.google.com/go/bigquery v1.62.0/go.mod h1:5ee+ZkF1x/ntgCsFQJAQTM3QkAZOecfCmvxhkJsWRSA=
+cloud.google.com/go/billing v1.18.8/go.mod h1:oFsuKhKiuxK7dDQ4a8tt5/1cScEo4IzhssWj6TTdi6k=
+cloud.google.com/go/binaryauthorization v1.8.6/go.mod h1:GAfktMiQW14Y67lIK5q9QSbzYc4NE/xIpQemVRhIVXc=
+cloud.google.com/go/certificatemanager v1.8.4/go.mod h1:knD4QGjaogN6hy/pk1f2Cz1fhU8oYeYSF710RRf+d6k=
+cloud.google.com/go/channel v1.17.10/go.mod h1:TzcYuXlpeex8O483ofkxbY/DKRF49NBumZTJPvjstVA=
+cloud.google.com/go/cloudbuild v1.16.4/go.mod h1:YSNmtWgg9lmL4st4+lej1XywNEUQnbyA/F+DdXPBevA=
+cloud.google.com/go/clouddms v1.7.9/go.mod h1:U2j8sOFtsIovea96mz2joyNMULl43TGadf7tOAUKKzs=
+cloud.google.com/go/cloudtasks v1.12.11/go.mod h1:uDR/oUmPZqL2rNz9M9MXvm07hkkLnvvUORbud8MA5p4=
+cloud.google.com/go/compute v1.27.3/go.mod h1:5GuDo3l1k9CFhfIHK1sXqlqOW/iWX4/eBlO5FtxDhvQ=
cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA=
-cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc=
cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k=
-cloud.google.com/go/contactcenterinsights v1.13.2/go.mod h1:AfkSB8t7mt2sIY6WpfO61nD9J9fcidIchtxm9FqJVXk=
-cloud.google.com/go/container v1.35.1/go.mod h1:udm8fgLm3TtpnjFN4QLLjZezAIIp/VnMo316yIRVRQU=
-cloud.google.com/go/containeranalysis v0.11.6/go.mod h1:YRf7nxcTcN63/Kz9f86efzvrV33g/UV8JDdudRbYEUI=
-cloud.google.com/go/datacatalog v1.20.0/go.mod h1:fSHaKjIroFpmRrYlwz9XBB2gJBpXufpnxyAKaT4w6L0=
-cloud.google.com/go/datacatalog v1.20.1/go.mod h1:Jzc2CoHudhuZhpv78UBAjMEg3w7I9jHA11SbRshWUjk=
-cloud.google.com/go/dataflow v0.9.7/go.mod h1:3BjkOxANrm1G3+/EBnEsTEEgJu1f79mFqoOOZfz3v+E=
-cloud.google.com/go/dataform v0.9.4/go.mod h1:jjo4XY+56UrNE0wsEQsfAw4caUs4DLJVSyFBDelRDtQ=
-cloud.google.com/go/datafusion v1.7.7/go.mod h1:qGTtQcUs8l51lFA9ywuxmZJhS4ozxsBSus6ItqCUWMU=
-cloud.google.com/go/datalabeling v0.8.7/go.mod h1:/PPncW5gxrU15UzJEGQoOT3IobeudHGvoExrtZ8ZBwo=
-cloud.google.com/go/dataplex v1.15.1/go.mod h1:+cUJLSCSIWfH53dIXOS5gLErCSz3MP0mZiswVVI8YTA=
-cloud.google.com/go/dataproc/v2 v2.4.2/go.mod h1:smGSj1LZP3wtnsM9eyRuDYftNAroAl6gvKp/Wk64XDE=
-cloud.google.com/go/dataqna v0.8.7/go.mod h1:hvxGaSvINAVH5EJJsONIwT1y+B7OQogjHPjizOFoWOo=
-cloud.google.com/go/datastore v1.16.0/go.mod h1:WIGbYyZE4GUJC+RLuVgpl6myNMKZGzlfbtN3Tch4R+8=
-cloud.google.com/go/datastream v1.10.6/go.mod h1:lPeXWNbQ1rfRPjBFBLUdi+5r7XrniabdIiEaCaAU55o=
-cloud.google.com/go/deploy v1.18.0/go.mod h1:7Nv2yKPQG5Lv3sscLUuY58DlrEMqPlq6nedtpb1Prcg=
-cloud.google.com/go/dialogflow v1.53.0/go.mod h1:LqAvxq7bXiiGC3/DWIz9XXCxth2z2qpSnBAAmlNOj6U=
-cloud.google.com/go/dlp v1.12.2/go.mod h1:AkJim14g+g5JqE4tTr9IJYQp2HHKhBYw/r/G6KQLQi0=
-cloud.google.com/go/documentai v1.28.0/go.mod h1:ZTt9RkTRmqOn5GQgU4JxHJxbobemOoo6FSy0byEQHqY=
-cloud.google.com/go/domains v0.9.7/go.mod h1:u/yVf3BgfPJW3QDZl51qTJcDXo9PLqnEIxfGmGgbHEc=
-cloud.google.com/go/edgecontainer v1.2.1/go.mod h1:OE2D0lbkmGDVYLCvpj8Y0M4a4K076QB7E2JupqOR/qU=
-cloud.google.com/go/errorreporting v0.3.0/go.mod h1:xsP2yaAp+OAW4OIm60An2bbLpqIhKXdWR/tawvl7QzU=
-cloud.google.com/go/essentialcontacts v1.6.8/go.mod h1:EHONVDSum2xxG2p+myyVda/FwwvGbY58ZYC4XqI/lDQ=
-cloud.google.com/go/eventarc v1.13.6/go.mod h1:QReOaYnDNdjwAQQWNC7nfr63WnaKFUw7MSdQ9PXJYj0=
-cloud.google.com/go/filestore v1.8.3/go.mod h1:QTpkYpKBF6jlPRmJwhLqXfJQjVrQisplyb4e2CwfJWc=
+cloud.google.com/go/compute/metadata v0.4.0/go.mod h1:SIQh1Kkb4ZJ8zJ874fqVkslA29PRXuleyj6vOzlbK7M=
+cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY=
+cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY=
+cloud.google.com/go/contactcenterinsights v1.13.5/go.mod h1:/27aGOSszuoT547CX4kTbF+4nMv3EIXN8+z+dJcMZco=
+cloud.google.com/go/container v1.37.3/go.mod h1:XKwtVfsTBsnZ9Ve1Pw2wkjk5kSjJqsHl3oBrbbi4w/M=
+cloud.google.com/go/containeranalysis v0.12.0/go.mod h1:a3Yo1yk1Dv4nVmlxcJWOJDqsnzy5I1HmETg2UGlERhs=
+cloud.google.com/go/datacatalog v1.20.3/go.mod h1:AKC6vAy5urnMg5eJK3oUjy8oa5zMbiY33h125l8lmlo=
+cloud.google.com/go/datacatalog v1.20.4/go.mod h1:71PDwywIYkNgSXdUU3H0mkTp3j15aahfYJ1CY3DogtU=
+cloud.google.com/go/dataflow v0.9.10/go.mod h1:lkhCwyVAOR4cKx+TzaxFbfh0tJcBVqxyIN97TDc/OJ8=
+cloud.google.com/go/dataform v0.9.7/go.mod h1:zJp0zOSCKHgt2IxTQ90vNeDfT7mdqFA8ZzrYIsxTEM0=
+cloud.google.com/go/datafusion v1.7.10/go.mod h1:MYRJjIUs2kVTbYySSp4+foNyq2MfgKTLMcsquEjbapM=
+cloud.google.com/go/datalabeling v0.8.10/go.mod h1:8+IBTdU0te7w9b7BoZzUl05XgPvgqOrxQMzoP47skGM=
+cloud.google.com/go/dataplex v1.18.1/go.mod h1:G5+muC3D5rLSHG9uKACs5WfRtthIVwyUJSIXi2Wzp30=
+cloud.google.com/go/dataproc/v2 v2.5.2/go.mod h1:KCr6aYKulU4Am8utvRoXKe1L2hPkfX9Ox0m/rvenUjU=
+cloud.google.com/go/dataqna v0.8.10/go.mod h1:e6Ula5UmCrbT7jOI6zZDwHHtAsDdKHKDrHSkj0pDlAQ=
+cloud.google.com/go/datastore v1.17.1/go.mod h1:mtzZ2HcVtz90OVrEXXGDc2pO4NM1kiBQy8YV4qGe0ZM=
+cloud.google.com/go/datastream v1.10.9/go.mod h1:LvUG7tBqMn9zDkgj5HlefDzaOth8ohVITF8qTtqAINw=
+cloud.google.com/go/deploy v1.19.3/go.mod h1:Ut73ILRKoxtcIWeRJyYwuhBAckuSE1KJXlSX38hf4B0=
+cloud.google.com/go/dialogflow v1.54.3/go.mod h1:Sm5uznNq8Vrj7R+Uc84qz41gW2AXRZeWgvJ9owKZw9g=
+cloud.google.com/go/dlp v1.14.3/go.mod h1:iyhOlJCSAGNP2z5YPoBjV+M9uhyiUuxjZDYqbvO3WMM=
+cloud.google.com/go/documentai v1.30.4/go.mod h1:1UqovvxIySy/sQwZcU1O+tm4qA/jnzAwzZLRIhFmhSk=
+cloud.google.com/go/domains v0.9.10/go.mod h1:8yArcduQ2fDThBQlnDSwxrkGRgduW8KK2Y/nlL1IU2o=
+cloud.google.com/go/edgecontainer v1.2.4/go.mod h1:QiHvO/Xc/8388oPuYZfHn9BpKx3dz1jWSi8Oex5MX6w=
+cloud.google.com/go/errorreporting v0.3.1/go.mod h1:6xVQXU1UuntfAf+bVkFk6nld41+CPyF2NSPCyXE3Ztk=
+cloud.google.com/go/essentialcontacts v1.6.11/go.mod h1:qpdkYSdPY4C69zprW20nKu+5DsED/Gwf1KtFHUSzrC0=
+cloud.google.com/go/eventarc v1.13.9/go.mod h1:Jn2EBCgvGXeqndphk0nUVgJm4ZJOhxx4yYcSasvNrh4=
+cloud.google.com/go/filestore v1.8.6/go.mod h1:ztH4U+aeH5vWtiyEd4+Dc56L2yRk7EIm0+PAR+9m5Jc=
cloud.google.com/go/firestore v1.15.0/go.mod h1:GWOxFXcv8GZUtYpWHw/w6IuYNux/BtmeVTMmjrm4yhk=
-cloud.google.com/go/functions v1.16.2/go.mod h1:+gMvV5E3nMb9EPqX6XwRb646jTyVz8q4yk3DD6xxHpg=
-cloud.google.com/go/gkebackup v1.4.1/go.mod h1:tVwSKC1/UxEA011ijRG8vlXaZThzTSy6vReO9fTOlX8=
-cloud.google.com/go/gkeconnect v0.8.7/go.mod h1:iUH1jgQpTyNFMK5LgXEq2o0beIJ2p7KKUUFerkf/eGc=
-cloud.google.com/go/gkehub v0.14.7/go.mod h1:NLORJVTQeCdxyAjDgUwUp0A6BLEaNLq84mCiulsM4OE=
-cloud.google.com/go/gkemulticloud v1.1.3/go.mod h1:4WzfPnsOfdCIj6weekE5FIGCaeQKZ1HzGNUVZ1PpIxw=
-cloud.google.com/go/grafeas v0.3.5/go.mod h1:y54iTBcI+lgUdI+kAPKb8jtPqeTkA2dsYzWSrQtpc5s=
-cloud.google.com/go/gsuiteaddons v1.6.7/go.mod h1:u+sGBvr07OKNnOnQiB/Co1q4U2cjo50ERQwvnlcpNis=
-cloud.google.com/go/iam v1.1.8 h1:r7umDwhj+BQyz0ScZMp4QrGXjSTI3ZINnpgU2nlB/K0=
-cloud.google.com/go/iam v1.1.8/go.mod h1:GvE6lyMmfxXauzNq8NbgJbeVQNspG+tcdL/W8QO1+zE=
-cloud.google.com/go/iap v1.9.6/go.mod h1:YiK+tbhDszhaVifvzt2zTEF2ch9duHtp6xzxj9a0sQk=
-cloud.google.com/go/ids v1.4.7/go.mod h1:yUkDC71u73lJoTaoONy0dsA0T7foekvg6ZRg9IJL0AA=
-cloud.google.com/go/iot v1.7.7/go.mod h1:tr0bCOSPXtsg64TwwZ/1x+ReTWKlQRVXbM+DnrE54yM=
-cloud.google.com/go/kms v1.15.9/go.mod h1:5v/R/RRuBUVO+eJioGcqENr3syh8ZqNn1y1Wc9DjM+4=
-cloud.google.com/go/language v1.12.5/go.mod h1:w/6a7+Rhg6Bc2Uzw6thRdKKNjnOzfKTJuxzD0JZZ0nM=
-cloud.google.com/go/lifesciences v0.9.7/go.mod h1:FQ713PhjAOHqUVnuwsCe1KPi9oAdaTfh58h1xPiW13g=
-cloud.google.com/go/logging v1.9.0/go.mod h1:1Io0vnZv4onoUnsVUQY3HZ3Igb1nBchky0A0y7BBBhE=
-cloud.google.com/go/longrunning v0.4.1/go.mod h1:4iWDqhBZ70CvZ6BfETbvam3T8FMvLK+eFj0E6AaRQTo=
-cloud.google.com/go/longrunning v0.5.2/go.mod h1:nqo6DQbNV2pXhGDbDMoN2bWz68MjZUzqv2YttZiveCs=
+cloud.google.com/go/functions v1.16.5/go.mod h1:ds5f+dyMN4kCkTWTLpQl8wMi0sLRuJWrQaWr5eFlUnQ=
+cloud.google.com/go/gkebackup v1.5.3/go.mod h1:fzWJXO5v0AzcC3J5KgCTpEcB0uvcC+e0YqIRVYQR4sE=
+cloud.google.com/go/gkeconnect v0.8.10/go.mod h1:2r9mjewv4bAEg0VXNqc7uJA2vWuDHy/44IzstIikFH8=
+cloud.google.com/go/gkehub v0.14.10/go.mod h1:+bqT9oyCDQG2Dc2pUJKYVNJGvrKgIfm7c+hk9IlDzJU=
+cloud.google.com/go/gkemulticloud v1.2.3/go.mod h1:CR97Vcd9XdDLZQtMPfXtbFWRxfIFuO9K6q7oF6+moco=
+cloud.google.com/go/grafeas v0.3.6/go.mod h1:to6ECAPgRO2xeqD8ISXHc70nObJuaKZThreQOjeOH3o=
+cloud.google.com/go/gsuiteaddons v1.6.10/go.mod h1:daIpNyqugkch134oS116DXGEVrLUt0kSdqvgi0U1DD8=
+cloud.google.com/go/iam v1.1.11 h1:0mQ8UKSfdHLut6pH9FM3bI55KWR46ketn0PuXleDyxw=
+cloud.google.com/go/iam v1.1.11/go.mod h1:biXoiLWYIKntto2joP+62sd9uW5EpkZmKIvfNcTWlnQ=
+cloud.google.com/go/iap v1.9.9/go.mod h1:7I7ftlLPPU8du0E8jW3koaYkNcX1NLqSDU9jQFRwF04=
+cloud.google.com/go/ids v1.4.10/go.mod h1:438ouAjmw7c4/3Q+KbQxuJTU3jek5xo6cVH7EduiKXs=
+cloud.google.com/go/iot v1.7.10/go.mod h1:rVBZ3srfCH4yPr2CPkxu3tB/c0avx0KV9K68zVNAh4Q=
+cloud.google.com/go/kms v1.18.3/go.mod h1:y/Lcf6fyhbdn7MrG1VaDqXxM8rhOBc5rWcWAhcvZjQU=
+cloud.google.com/go/language v1.12.8/go.mod h1:3706JYCNJKvNXZZzcf7PGUMR2IuEYXQ0o7KqyOLqw+s=
+cloud.google.com/go/lifesciences v0.9.10/go.mod h1:zm5Y46HXN/ZoVdQ8HhXJvXG+m4De1HoJye62r/DFXoU=
+cloud.google.com/go/logging v1.10.0/go.mod h1:EHOwcxlltJrYGqMGfghSet736KR3hX1MAj614mrMk9I=
cloud.google.com/go/longrunning v0.5.5/go.mod h1:WV2LAxD8/rg5Z1cNW6FJ/ZpX4E4VnDnoTk0yawPBB7s=
-cloud.google.com/go/longrunning v0.5.6/go.mod h1:vUaDrWYOMKRuhiv6JBnn49YxCPz2Ayn9GqyjaBT8/mA=
cloud.google.com/go/longrunning v0.5.7/go.mod h1:8GClkudohy1Fxm3owmBGid8W0pSgodEMwEAztp38Xng=
-cloud.google.com/go/managedidentities v1.6.7/go.mod h1:UzslJgHnc6luoyx2JV19cTCi2Fni/7UtlcLeSYRzTV8=
-cloud.google.com/go/maps v1.7.3/go.mod h1:Jfe+h0i3YdG8Cc0wuNI+Q+WglTt7YnQ3PbKCqpBdTwc=
-cloud.google.com/go/mediatranslation v0.8.7/go.mod h1:6eJbPj1QJwiCP8R4K413qMx6ZHZJUi9QFpApqY88xWU=
-cloud.google.com/go/memcache v1.10.7/go.mod h1:SrU6+QBhvXJV0TA59+B3oCHtLkPx37eqdKmRUlmSE1k=
-cloud.google.com/go/metastore v1.13.6/go.mod h1:OBCVMCP7X9vA4KKD+5J4Q3d+tiyKxalQZnksQMq5MKY=
-cloud.google.com/go/monitoring v1.19.0/go.mod h1:25IeMR5cQ5BoZ8j1eogHE5VPJLlReQ7zFp5OiLgiGZw=
-cloud.google.com/go/networkconnectivity v1.14.6/go.mod h1:/azB7+oCSmyBs74Z26EogZ2N3UcXxdCHkCPcz8G32bU=
-cloud.google.com/go/networkmanagement v1.13.2/go.mod h1:24VrV/5HFIOXMEtVQEUoB4m/w8UWvUPAYjfnYZcBc4c=
-cloud.google.com/go/networksecurity v0.9.7/go.mod h1:aB6UiPnh/l32+TRvgTeOxVRVAHAFFqvK+ll3idU5BoY=
-cloud.google.com/go/notebooks v1.11.5/go.mod h1:pz6P8l2TvhWqAW3sysIsS0g2IUJKOzEklsjWJfi8sd4=
-cloud.google.com/go/optimization v1.6.5/go.mod h1:eiJjNge1NqqLYyY75AtIGeQWKO0cvzD1ct/moCFaP2Q=
-cloud.google.com/go/orchestration v1.9.2/go.mod h1:8bGNigqCQb/O1kK7PeStSNlyi58rQvZqDiuXT9KAcbg=
-cloud.google.com/go/orgpolicy v1.12.2/go.mod h1:XycP+uWN8Fev47r1XibYjOgZod8SjXQtZGsO2I8KXX8=
-cloud.google.com/go/orgpolicy v1.12.3/go.mod h1:6BOgIgFjWfJzTsVcib/4QNHOAeOjCdaBj69aJVs//MA=
-cloud.google.com/go/osconfig v1.12.6/go.mod h1:2dcXGl5qNbKo6Hjsnqbt5t6H2GX7UCAaPjF6BwDlFq8=
-cloud.google.com/go/osconfig v1.12.7/go.mod h1:ID7Lbqr0fiihKMwAOoPomWRqsZYKWxfiuafNZ9j1Y1M=
-cloud.google.com/go/oslogin v1.13.3/go.mod h1:WW7Rs1OJQ1iSUckZDilvNBSNPE8on740zF+4ZDR4o8U=
-cloud.google.com/go/phishingprotection v0.8.7/go.mod h1:FtYaOyGc/HQQU7wY4sfwYZBFDKAL+YtVBjUj8E3A3/I=
-cloud.google.com/go/policytroubleshooter v1.10.5/go.mod h1:bpOf94YxjWUqsVKokzPBibMSAx937Jp2UNGVoMAtGYI=
-cloud.google.com/go/privatecatalog v0.9.7/go.mod h1:NWLa8MCL6NkRSt8jhL8Goy2A/oHkvkeAxiA0gv0rIXI=
-cloud.google.com/go/pubsub v1.38.0/go.mod h1:IPMJSWSus/cu57UyR01Jqa/bNOQA+XnPF6Z4dKW4fAA=
-cloud.google.com/go/pubsublite v1.8.1/go.mod h1:fOLdU4f5xldK4RGJrBMm+J7zMWNj/k4PxwEZXy39QS0=
-cloud.google.com/go/recaptchaenterprise/v2 v2.13.0/go.mod h1:jNYyn2ScR4DTg+VNhjhv/vJQdaU8qz+NpmpIzEE7HFQ=
-cloud.google.com/go/recommendationengine v0.8.7/go.mod h1:YsUIbweUcpm46OzpVEsV5/z+kjuV6GzMxl7OAKIGgKE=
-cloud.google.com/go/recommender v1.12.3/go.mod h1:OgN0MjV7/6FZUUPgF2QPQtYErtZdZc4u+5onvurcGEI=
-cloud.google.com/go/redis v1.14.4/go.mod h1:EnHDflqTNQmCBPCN4FQPZdM28vLdweAgxe6avAZpqug=
-cloud.google.com/go/resourcemanager v1.9.7/go.mod h1:cQH6lJwESufxEu6KepsoNAsjrUtYYNXRwxm4QFE5g8A=
-cloud.google.com/go/resourcesettings v1.6.7/go.mod h1:zwRL5ZoNszs1W6+eJYMk6ILzgfnTj13qfU4Wvfupuqk=
-cloud.google.com/go/retail v1.16.2/go.mod h1:T7UcBh4/eoxRBpP3vwZCoa+PYA9/qWRTmOCsV8DRdZ0=
-cloud.google.com/go/run v1.3.7/go.mod h1:iEUflDx4Js+wK0NzF5o7hE9Dj7QqJKnRj0/b6rhVq20=
-cloud.google.com/go/scheduler v1.10.8/go.mod h1:0YXHjROF1f5qTMvGTm4o7GH1PGAcmu/H/7J7cHOiHl0=
-cloud.google.com/go/secretmanager v1.13.0/go.mod h1:yWdfNmM2sLIiyv6RM6VqWKeBV7CdS0SO3ybxJJRhBEs=
-cloud.google.com/go/security v1.16.1/go.mod h1:UoF8QXvvJlV9ORs4YW/izW5GmDQtFUoq2P6TJgPlif8=
-cloud.google.com/go/securitycenter v1.30.0/go.mod h1:/tmosjS/dfTnzJxOzZhTXdX3MXWsCmPWfcYOgkJmaJk=
-cloud.google.com/go/servicedirectory v1.11.6/go.mod h1:peVGYNc1xArhcqSuhPP+NXp8kdl22XhB5E8IiNBNfZY=
-cloud.google.com/go/shell v1.7.7/go.mod h1:7OYaMm3TFMSZBh8+QYw6Qef+fdklp7CjjpxYAoJpZbQ=
-cloud.google.com/go/spanner v1.61.0/go.mod h1:+hdNE+zL7EWNfOWRetw01jxz8H5qsE/ayZvF/pfrAl8=
-cloud.google.com/go/speech v1.23.1/go.mod h1:UNgzNxhNBuo/OxpF1rMhA/U2rdai7ILL6PBXFs70wq0=
-cloud.google.com/go/storage v1.40.0 h1:VEpDQV5CJxFmJ6ueWNsKxcr1QAYOXEgxDa+sBbJahPw=
-cloud.google.com/go/storage v1.40.0/go.mod h1:Rrj7/hKlG87BLqDJYtwR0fbPld8uJPbQ2ucUMY7Ir0g=
-cloud.google.com/go/storagetransfer v1.10.6/go.mod h1:3sAgY1bx1TpIzfSzdvNGHrGYldeCTyGI/Rzk6Lc6A7w=
-cloud.google.com/go/talent v1.6.8/go.mod h1:kqPAJvhxmhoUTuqxjjk2KqA8zUEeTDmH+qKztVubGlQ=
-cloud.google.com/go/texttospeech v1.7.7/go.mod h1:XO4Wr2VzWHjzQpMe3gS58Oj68nmtXMyuuH+4t0wy9eA=
-cloud.google.com/go/tpu v1.6.7/go.mod h1:o8qxg7/Jgt7TCgZc3jNkd4kTsDwuYD3c4JTMqXZ36hU=
-cloud.google.com/go/trace v1.10.7/go.mod h1:qk3eiKmZX0ar2dzIJN/3QhY2PIFh1eqcIdaN5uEjQPM=
-cloud.google.com/go/translate v1.10.3/go.mod h1:GW0vC1qvPtd3pgtypCv4k4U8B7EdgK9/QEF2aJEUovs=
-cloud.google.com/go/video v1.20.6/go.mod h1:d5AOlIfWXpDg15wvztHmjFvKTTImWJU7EnMVWkoiEAk=
-cloud.google.com/go/videointelligence v1.11.7/go.mod h1:iMCXbfjurmBVgKuyLedTzv90kcnppOJ6ttb0+rLDID0=
-cloud.google.com/go/vision/v2 v2.8.2/go.mod h1:BHZA1LC7dcHjSr9U9OVhxMtLKd5l2jKPzLRALEJvuaw=
-cloud.google.com/go/vmmigration v1.7.7/go.mod h1:qYIK5caZY3IDMXQK+A09dy81QU8qBW0/JDTc39OaKRw=
-cloud.google.com/go/vmwareengine v1.1.3/go.mod h1:UoyF6LTdrIJRvDN8uUB8d0yimP5A5Ehkr1SRzL1APZw=
-cloud.google.com/go/vpcaccess v1.7.7/go.mod h1:EzfSlgkoAnFWEMznZW0dVNvdjFjEW97vFlKk4VNBhwY=
-cloud.google.com/go/webrisk v1.9.7/go.mod h1:7FkQtqcKLeNwXCdhthdXHIQNcFWPF/OubrlyRcLHNuQ=
-cloud.google.com/go/websecurityscanner v1.6.7/go.mod h1:EpiW84G5KXxsjtFKK7fSMQNt8JcuLA8tQp7j0cyV458=
-cloud.google.com/go/workflows v1.12.6/go.mod h1:oDbEHKa4otYg4abwdw2Z094jB0TLLiFGAPA78EDAKag=
-code.cloudfoundry.org/bytefmt v0.0.0-20240507165102-251b29179075 h1:/EIavdKMlm6qZfFDnXJfu2M2R2jFctue9C4BF742EtE=
-code.cloudfoundry.org/bytefmt v0.0.0-20240507165102-251b29179075/go.mod h1:KghGLYo7qPX+I2O+IKHD3in3uE/bYcXmuL0jb6I0mRM=
+cloud.google.com/go/longrunning v0.5.9/go.mod h1:HD+0l9/OOW0za6UWdKJtXoFAX/BGg/3Wj8p10NeWF7c=
+cloud.google.com/go/longrunning v0.5.10 h1:eB/BniENNRKhjz/xgiillrdcH3G74TGSl3BXinGlI7E=
+cloud.google.com/go/longrunning v0.5.10/go.mod h1:tljz5guTr5oc/qhlUjBlk7UAIFMOGuPNxkNDZXlLics=
+cloud.google.com/go/managedidentities v1.6.10/go.mod h1:Dg+K/AgKJtOyDjrrMGh4wFrEmtlUUcoEtDdC/WsZxw4=
+cloud.google.com/go/maps v1.11.4/go.mod h1:RQ2Vv/f2HKGlvCtj8xyJp8gJbVqh/CWy0xR2Nfe8c0s=
+cloud.google.com/go/mediatranslation v0.8.10/go.mod h1:sCTNVpO4Yh9LbkjelsGakWBi93u9THKfKQLSGSLS7rA=
+cloud.google.com/go/memcache v1.10.10/go.mod h1:UXnN6UYNoNM6RTExZ7/iW9c2mAaeJjy7R7uaplNRmIc=
+cloud.google.com/go/metastore v1.13.9/go.mod h1:KgRseDRcS7Um/mNLbRHJjXZQrK8MqlGSyEga7T/Vs1A=
+cloud.google.com/go/monitoring v1.20.2/go.mod h1:36rpg/7fdQ7NX5pG5x1FA7cXTVXusOp6Zg9r9e1+oek=
+cloud.google.com/go/networkconnectivity v1.14.9/go.mod h1:J1JgZDeSi/elFfOSLkMoY9REuGhoNXqOFuI0cfyS6WY=
+cloud.google.com/go/networkmanagement v1.13.5/go.mod h1:znPuYKLqWJLzLI9feH6ex+Mq+6VlexfiUR8F6sFOtGo=
+cloud.google.com/go/networksecurity v0.9.10/go.mod h1:pHy4lna09asqVhLwHVUXn92KGlM5oj1iSLFUwqqGZ2g=
+cloud.google.com/go/notebooks v1.11.8/go.mod h1:jkRKhXWSXtzKtoPd9QeDzHrMPTYxf4l1rQP1/+6iR9g=
+cloud.google.com/go/optimization v1.6.8/go.mod h1:d/uDAEVA0JYzWO3bCcuC6nnZKTjrSWhNkCTFUOV39g0=
+cloud.google.com/go/orchestration v1.9.5/go.mod h1:64czIksdxj1B3pu0JXHVqwSmCZEoJfmuJWssWRXrVsc=
+cloud.google.com/go/orgpolicy v1.12.5/go.mod h1:f778/jOHKp6cP6NbbQgjy4SDfQf6BoVGiSWdxky3ONQ=
+cloud.google.com/go/orgpolicy v1.12.6/go.mod h1:yEkOiKK4w2tBzxLFvjO9kqoIRBXoF29vFeNqhGiifpE=
+cloud.google.com/go/osconfig v1.13.0/go.mod h1:tlACnQi1rtSLnHRYzfw9SH9zXs0M7S1jqiW2EOCn2Y0=
+cloud.google.com/go/osconfig v1.13.1/go.mod h1:3EcPSKozSco5jbdv2CZDojH0RVcRKvOdPrkrl+iHwuI=
+cloud.google.com/go/oslogin v1.13.6/go.mod h1:7g1whx5UORkP8K8qGFhlc6njxFA35SX1V4dDNpWWku0=
+cloud.google.com/go/phishingprotection v0.8.10/go.mod h1:QJKnexvHGqL3u0qshpJBsjqCo+EEy3K/PrvogvcON8Q=
+cloud.google.com/go/policytroubleshooter v1.10.8/go.mod h1:d+6phd7MABmER7PCqlHSWGE35NFDMJfu7cLjTr820UE=
+cloud.google.com/go/privatecatalog v0.9.10/go.mod h1:RxEAFdbH+8Ogu+1Lfp43KuAC6YIj46zWyoCX1dWB9nk=
+cloud.google.com/go/pubsub v1.40.0/go.mod h1:BVJI4sI2FyXp36KFKvFwcfDRDfR8MiLT8mMhmIhdAeA=
+cloud.google.com/go/pubsublite v1.8.2/go.mod h1:4r8GSa9NznExjuLPEJlF1VjOPOpgf3IT6k8x/YgaOPI=
+cloud.google.com/go/recaptchaenterprise/v2 v2.14.1/go.mod h1:s1dcJEzWpEsgZN8aqHacC3mWUaQPd8q/QoibU/nkr18=
+cloud.google.com/go/recommendationengine v0.8.10/go.mod h1:vlLaupkdqL3wuabhhjvrpH7TFswyxO6+P0L3AqrATPU=
+cloud.google.com/go/recommender v1.12.6/go.mod h1:BNNC/CEIGV3y6hQNjewrVx80PIidfFtf8D+6SCEgLnA=
+cloud.google.com/go/redis v1.16.3/go.mod h1:zqagsFk9fZzFKJB5NzijOUi53BeU5jUiPa4Kz/8Qz+Q=
+cloud.google.com/go/resourcemanager v1.9.10/go.mod h1:UJ5zGD2ZD+Ng3MNxkU1fwBbpJQEQE1UctqpvV5pbP1M=
+cloud.google.com/go/resourcesettings v1.7.3/go.mod h1:lMSnOoQPDKzcF6LGJOBcQqGCY2Zm8ZhbHEzhqdU61S8=
+cloud.google.com/go/retail v1.17.3/go.mod h1:8OWmRAUXg8PKs1ef+VwrBLYBRdYJxq+YyxiytMaUBRI=
+cloud.google.com/go/run v1.3.10/go.mod h1:zQGa7V57WWZhyiUYMlYitrBZzR+d2drzJQvrpaQ8YIA=
+cloud.google.com/go/scheduler v1.10.11/go.mod h1:irpDaNL41B5q8hX/Ki87hzkxO8FnZEhhZnFk6OP8TnE=
+cloud.google.com/go/secretmanager v1.13.4/go.mod h1:SjKHs6rx0ELUqfbRWrWq4e7SiNKV7QMWZtvZsQm3k5w=
+cloud.google.com/go/security v1.17.3/go.mod h1:CuKzQq5OD6TXAYaZs/jI0d7CNHoD0LXbpsznIIIn4f4=
+cloud.google.com/go/securitycenter v1.33.0/go.mod h1:lkEPItFjC1RRBHniiWR3lJTpUJW+7+EFAb7nP5ZCQxI=
+cloud.google.com/go/servicedirectory v1.11.10/go.mod h1:pgbBjH2r73lEd3Y7eNA64fRO3g1zL96PMu+/hAjkH6g=
+cloud.google.com/go/shell v1.7.10/go.mod h1:1sKAD5ijarrTLPX0VMQai6jCduRxaU2A6w0JWVGCNag=
+cloud.google.com/go/spanner v1.64.0/go.mod h1:TOFx3pb2UwPsDGlE1gTehW+y6YlU4IFk+VdDHSGQS/M=
+cloud.google.com/go/speech v1.23.4/go.mod h1:pv5VPKuXsZStCnTBImQP8HDfQHgG4DxJSlDyx5Kcwak=
+cloud.google.com/go/storage v1.43.0 h1:CcxnSohZwizt4LCzQHWvBf1/kvtHUn7gk9QERXPyXFs=
+cloud.google.com/go/storage v1.43.0/go.mod h1:ajvxEa7WmZS1PxvKRq4bq0tFT3vMd502JwstCcYv0Q0=
+cloud.google.com/go/storagetransfer v1.10.9/go.mod h1:QKkg5Wau5jc0iXlPOZyEv3hH9mjCLeYIBiRrZTf6Ehw=
+cloud.google.com/go/talent v1.6.11/go.mod h1:tmMptbP5zTw6tjudgip8LObeh7E4xHNC/IYsiGtxnrc=
+cloud.google.com/go/texttospeech v1.7.10/go.mod h1:ChThPazSxR7e4qe9ryRlFGU4lRONvL9Oo2geyp7LX4o=
+cloud.google.com/go/tpu v1.6.10/go.mod h1:O+N+S0i3bOH6NJ+s9GPsg9LC7jnE1HRSp8CSRYjCrfM=
+cloud.google.com/go/trace v1.10.10/go.mod h1:5b1BiSYQO27KgGRevNFfoIQ8czwpVgnkKbTLb4wV+XM=
+cloud.google.com/go/translate v1.10.6/go.mod h1:vqZOHurggOqpssx/agK9S21UdStpwugMOhlHvWEGAdw=
+cloud.google.com/go/video v1.21.3/go.mod h1:tp2KqkcxNEL5k2iF2Hd38aIWlNo/ew+i1yklhlyq6BM=
+cloud.google.com/go/videointelligence v1.11.10/go.mod h1:5oW8qq+bk8Me+3fNoQK+27CCw4Nsuk/YN7zMw7vNDTA=
+cloud.google.com/go/vision/v2 v2.8.5/go.mod h1:3X2ni4uSzzqpj8zTUD6aia62O1NisD19JH3l5i0CoM4=
+cloud.google.com/go/vmmigration v1.7.10/go.mod h1:VkoA4ktmA0C3fr7LqhthGtGWEmgM7WHWg6ObxeXR5lU=
+cloud.google.com/go/vmwareengine v1.1.6/go.mod h1:9txHCR2yJ6H9pFsfehTXLte5uvl/wOiM2PCtcVfglvI=
+cloud.google.com/go/vpcaccess v1.7.10/go.mod h1:69kdbMh8wvGcM3agEHP1YnHPyxIBSRcZuK+KWZlpVLI=
+cloud.google.com/go/webrisk v1.9.10/go.mod h1:wDxtALjJMXlGR2c3qtZaVI5jRKcneIMTYqV1IA1jPmo=
+cloud.google.com/go/websecurityscanner v1.6.10/go.mod h1:ndil05bWkG/KDgWAXwFFAuvOYcOKu+mk/wC/nIfLQwE=
+cloud.google.com/go/workflows v1.12.9/go.mod h1:g9S8NdA20MnQTReKVrXCDsnPrOsNgwonY7xZn+vr3SY=
+code.cloudfoundry.org/bytefmt v0.0.0-20240722180632-e94c220fe743 h1:fOrDvk3V6DqIc2Dfe1VuVwOET7e+l1f/+j+xSA41dKM=
+code.cloudfoundry.org/bytefmt v0.0.0-20240722180632-e94c220fe743/go.mod h1:/Mb4KbzA9wTtmZf3MVP6bAvvlxD/wxPx+k4xMsIoXlA=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20201218220906-28db891af037/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20221208032759-85de2813cf6b/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
eliasnaur.com/font v0.0.0-20230308162249-dd43949cb42d/go.mod h1:OYVuxibdk9OSLX8vAqydtRPP87PyTFcT9uH3MlEGBQA=
@@ -152,10 +159,12 @@ filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4
fyne.io/fyne v1.4.3/go.mod h1:8kiPBNSDmuplxs9WnKCkaWYqbcXFy0DeAzwa6PBO9Z8=
fyne.io/fyne/v2 v2.3.5/go.mod h1:fbrL+kwOQ6sdVhnURktTHIRIEXwysQSLeejyFyABmNI=
fyne.io/systray v1.10.1-0.20230602210930-b6a2d6ca2a7b/go.mod h1:oM2AQqGJ1AMo4nNqZFYU8xYygSBZkW2hmdJ7n4yjedE=
+gioui.org v0.0.0-20210822154628-43a7030f6e0b/go.mod h1:jmZ349gZNGWyc5FIv/VWLBQ32Ki/FOvTgEz64kh9lnk=
gioui.org v0.2.0/go.mod h1:1H72sKEk/fNFV+l0JNeM2Dt3co3Y4uaQcD+I+/GQ0e4=
gioui.org/cpu v0.0.0-20210808092351-bfe733dd3334/go.mod h1:A8M0Cn5o+vY5LTMlnRoK3O5kG+rH0kWfJjeKd9QpBmQ=
gioui.org/cpu v0.0.0-20210817075930-8d6a761490d2/go.mod h1:A8M0Cn5o+vY5LTMlnRoK3O5kG+rH0kWfJjeKd9QpBmQ=
gioui.org/cpu v0.0.0-20220412190645-f1e9e8c3b1f7/go.mod h1:A8M0Cn5o+vY5LTMlnRoK3O5kG+rH0kWfJjeKd9QpBmQ=
+gioui.org/shader v1.0.0/go.mod h1:mWdiME581d/kV7/iEhLmUgUK5iZ09XR5XpduXzbePVM=
gioui.org/shader v1.0.6/go.mod h1:mWdiME581d/kV7/iEhLmUgUK5iZ09XR5XpduXzbePVM=
gioui.org/x v0.2.0/go.mod h1:rCGN2nZ8ZHqrtseJoQxCMZpt2xrZUrdZ2WuMRLBJmYs=
git.sr.ht/~jackmordaunt/go-toast v1.0.0/go.mod h1:aIuRX/HdBOz7yRS8rOVYQCwJQlFS7DbYBTpUV0SHeeg=
@@ -166,14 +175,14 @@ git.sr.ht/~sbinet/gg v0.5.0/go.mod h1:G2C0eRESqlKhS7ErsNey6HHrqU1PwsnCQlekFi9Q2O
git.wow.st/gmp/jni v0.0.0-20210610011705-34026c7e22d0/go.mod h1:+axXBRUTIDlCeE73IKeD/os7LoEnTKdkp8/gQOFjqyo=
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8=
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
-github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
+github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7OputlJIzU=
github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU=
github.com/GoogleCloudPlatform/grpc-gcp-go/grpcgcp v1.5.0/go.mod h1:dppbR7CwXD4pgtV9t3wD1812RaLDcBjtblcDF5f1vI0=
github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk=
github.com/Kodeworks/golang-image-ico v0.0.0-20141118225523-73f0f4cfade9/go.mod h1:7uhhqiBaR4CpN0k9rMjOtjpcfGd6DG2m04zQxKnWQ0I=
-github.com/ajstarks/deck v0.0.0-20240329135147-d1f085d9d01e/go.mod h1:RuIzK38BeA036XEv6Cyl34k98GMwIuciL8v5f+yjo0k=
-github.com/ajstarks/deck/generate v0.0.0-20240329135147-d1f085d9d01e/go.mod h1:al/X+Mdfx3esXeGnnIVn5aYB6SfwTu+9T0u4EXmKJuk=
+github.com/ajstarks/deck v0.0.0-20240717142941-38ed00367aa6/go.mod h1:5o5HzZ3nUiOivE0SPQepE7oNquDd+9yip0PtlFpq888=
+github.com/ajstarks/deck/generate v0.0.0-20240717142941-38ed00367aa6/go.mod h1:al/X+Mdfx3esXeGnnIVn5aYB6SfwTu+9T0u4EXmKJuk=
github.com/ajstarks/fc v0.0.0-20230606144319-ef5d5cb73a3d/go.mod h1:Qp3TfzbBiIjHwDxIpu+g9nYfNw+xXF2Yqp4WmMlTtwM=
github.com/ajstarks/openvg v0.0.0-20191008131700-c6885d824eb8/go.mod h1:jpZHIkd4sQEgrzshrUQrRfv5OUMMq0w/Q1yK6ZYhUlk=
github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b h1:slYM766cy2nI3BwyRiyQj/Ud48djTMtMebDqepE95rw=
@@ -194,53 +203,53 @@ github.com/apache/arrow/go/v15 v15.0.2/go.mod h1:DGXsR3ajT524njufqf95822i+KTh+ye
github.com/apache/thrift v0.17.0/go.mod h1:OLxhMRJxomX+1I/KUw03qoV3mMz16BwaKI+d4fPBx7Q=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
-github.com/aws/aws-sdk-go v1.52.4 h1:9VsBVJ2TKf8xPP3+yIPGSYcEBIEymXsJzQoFgQuyvA0=
-github.com/aws/aws-sdk-go v1.52.4/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
-github.com/aws/aws-sdk-go-v2 v1.26.1 h1:5554eUqIYVWpU0YmeeYZ0wU64H2VLBs8TlhRB2L+EkA=
-github.com/aws/aws-sdk-go-v2 v1.26.1/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM=
-github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 h1:x6xsQXGSmW6frevwDA+vi/wqhp1ct18mVXYN08/93to=
-github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2/go.mod h1:lPprDr1e6cJdyYeGXnRaJoP4Md+cDBvi2eOj00BlGmg=
-github.com/aws/aws-sdk-go-v2/config v1.27.11 h1:f47rANd2LQEYHda2ddSCKYId18/8BhSRM4BULGmfgNA=
-github.com/aws/aws-sdk-go-v2/config v1.27.11/go.mod h1:SMsV78RIOYdve1vf36z8LmnszlRWkwMQtomCAI0/mIE=
-github.com/aws/aws-sdk-go-v2/credentials v1.17.11 h1:YuIB1dJNf1Re822rriUOTxopaHHvIq0l/pX3fwO+Tzs=
-github.com/aws/aws-sdk-go-v2/credentials v1.17.11/go.mod h1:AQtFPsDH9bI2O+71anW6EKL+NcD7LG3dpKGMV4SShgo=
-github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1 h1:FVJ0r5XTHSmIHJV6KuDmdYhEpvlHpiSd38RQWhut5J4=
-github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1/go.mod h1:zusuAeqezXzAB24LGuzuekqMAEgWkVYukBec3kr3jUg=
-github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.15 h1:7Zwtt/lP3KNRkeZre7soMELMGNoBrutx8nobg1jKWmo=
-github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.15/go.mod h1:436h2adoHb57yd+8W+gYPrrA9U/R/SuAuOO42Ushzhw=
-github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5 h1:aw39xVGeRWlWx9EzGVnhOR4yOjQDHPQ6o6NmBlscyQg=
-github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5/go.mod h1:FSaRudD0dXiMPK2UjknVwwTYyZMRsHv3TtkabsZih5I=
-github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5 h1:PG1F3OD1szkuQPzDw3CIQsRIrtTlUC3lP84taWzHlq0=
-github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5/go.mod h1:jU1li6RFryMz+so64PpKtudI+QzbKoIEivqdf6LNpOc=
+github.com/aws/aws-sdk-go v1.55.1 h1:ZTNPmbRMxaK5RlTJrBullX9r/rF1MPf3yAJOLlwDiT8=
+github.com/aws/aws-sdk-go v1.55.1/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
+github.com/aws/aws-sdk-go-v2 v1.30.3 h1:jUeBtG0Ih+ZIFH0F4UkmL9w3cSpaMv9tYYDbzILP8dY=
+github.com/aws/aws-sdk-go-v2 v1.30.3/go.mod h1:nIQjQVp5sfpQcTc9mPSr1B0PaWK5ByX9MOoDadSN4lc=
+github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3 h1:tW1/Rkad38LA15X4UQtjXZXNKsCgkshC3EbmcUmghTg=
+github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3/go.mod h1:UbnqO+zjqk3uIt9yCACHJ9IVNhyhOCnYk8yA19SAWrM=
+github.com/aws/aws-sdk-go-v2/config v1.27.27 h1:HdqgGt1OAP0HkEDDShEl0oSYa9ZZBSOmKpdpsDMdO90=
+github.com/aws/aws-sdk-go-v2/config v1.27.27/go.mod h1:MVYamCg76dFNINkZFu4n4RjDixhVr51HLj4ErWzrVwg=
+github.com/aws/aws-sdk-go-v2/credentials v1.17.27 h1:2raNba6gr2IfA0eqqiP2XiQ0UVOpGPgDSi0I9iAP+UI=
+github.com/aws/aws-sdk-go-v2/credentials v1.17.27/go.mod h1:gniiwbGahQByxan6YjQUMcW4Aov6bLC3m+evgcoN4r4=
+github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11 h1:KreluoV8FZDEtI6Co2xuNk/UqI9iwMrOx/87PBNIKqw=
+github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11/go.mod h1:SeSUYBLsMYFoRvHE0Tjvn7kbxaUhl75CJi1sbfhMxkU=
+github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.8 h1:u1KOU1S15ufyZqmH/rA3POkiRH6EcDANHj2xHRzq+zc=
+github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.8/go.mod h1:WPv2FRnkIOoDv/8j2gSUsI4qDc7392w5anFB/I89GZ8=
+github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15 h1:SoNJ4RlFEQEbtDcCEt+QG56MY4fm4W8rYirAmq+/DdU=
+github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15/go.mod h1:U9ke74k1n2bf+RIgoX1SXFed1HLs51OgUSs+Ph0KJP8=
+github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15 h1:C6WHdGnTDIYETAm5iErQUiVNsclNx9qbJVPIt03B6bI=
+github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15/go.mod h1:ZQLZqhcu+JhSrA9/NXRm8SkDvsycE+JkV3WGY41e+IM=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.3 h1:mDnFOE2sVkyphMWtTH+stv0eW3k0OTx94K63xpxHty4=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.3/go.mod h1:V8MuRVcCRt5h1S+Fwu8KbC7l/gBGo3yBAyUbJM2IJOk=
-github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 h1:Ji0DY1xUsUr3I8cHps0G+XM3WWU16lP6yG8qu1GAZAs=
-github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2/go.mod h1:5CsjAbs3NlGQyZNFACh+zztPDI7fU6eW9QsxjfnuBKg=
-github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.7 h1:ZMeFZ5yk+Ek+jNr1+uwCd2tG89t6oTS5yVWpa6yy2es=
-github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.7/go.mod h1:mxV05U+4JiHqIpGqqYXOHLPKUC6bDXC44bsUhNjOEwY=
-github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7 h1:ogRAwT1/gxJBcSWDMZlgyFUM962F51A5CRhDLbxLdmo=
-github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7/go.mod h1:YCsIZhXfRPLFFCl5xxY+1T9RKzOKjCut+28JSX2DnAk=
-github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.5 h1:f9RyWNtS8oH7cZlbn+/JNPpjUk5+5fLd5lM9M0i49Ys=
-github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.5/go.mod h1:h5CoMZV2VF297/VLhRhO1WF+XYWOzXo+4HsObA4HjBQ=
-github.com/aws/aws-sdk-go-v2/service/s3 v1.53.1 h1:6cnno47Me9bRykw9AEv9zkXE+5or7jz8TsskTTccbgc=
-github.com/aws/aws-sdk-go-v2/service/s3 v1.53.1/go.mod h1:qmdkIIAC+GCLASF7R2whgNrJADz0QZPX+Seiw/i4S3o=
-github.com/aws/aws-sdk-go-v2/service/sso v1.20.5 h1:vN8hEbpRnL7+Hopy9dzmRle1xmDc7o8tmY0klsr175w=
-github.com/aws/aws-sdk-go-v2/service/sso v1.20.5/go.mod h1:qGzynb/msuZIE8I75DVRCUXw3o3ZyBmUvMwQ2t/BrGM=
+github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3 h1:dT3MqvGhSoaIhRseqw2I0yH81l7wiR2vjs57O51EAm8=
+github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3/go.mod h1:GlAeCkHwugxdHaueRr4nhPuY+WW+gR8UjlcqzPr1SPI=
+github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.17 h1:YPYe6ZmvUfDDDELqEKtAd6bo8zxhkm+XEFEzQisqUIE=
+github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.17/go.mod h1:oBtcnYua/CgzCWYN7NZ5j7PotFDaFSUjCYVTtfyn7vw=
+github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17 h1:HGErhhrxZlQ044RiM+WdoZxp0p+EGM62y3L6pwA4olE=
+github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17/go.mod h1:RkZEx4l0EHYDJpWppMJ3nD9wZJAa8/0lq9aVC+r2UII=
+github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.15 h1:246A4lSTXWJw/rmlQI+TT2OcqeDMKBdyjEQrafMaQdA=
+github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.15/go.mod h1:haVfg3761/WF7YPuJOER2MP0k4UAXyHaLclKXB6usDg=
+github.com/aws/aws-sdk-go-v2/service/s3 v1.58.2 h1:sZXIzO38GZOU+O0C+INqbH7C2yALwfMWpd64tONS/NE=
+github.com/aws/aws-sdk-go-v2/service/s3 v1.58.2/go.mod h1:Lcxzg5rojyVPU/0eFwLtcyTaek/6Mtic5B1gJo7e/zE=
+github.com/aws/aws-sdk-go-v2/service/sso v1.22.4 h1:BXx0ZIxvrJdSgSvKTZ+yRBeSqqgPM89VPlulEcl37tM=
+github.com/aws/aws-sdk-go-v2/service/sso v1.22.4/go.mod h1:ooyCOXjvJEsUw7x+ZDHeISPMhtwI3ZCB7ggFMcFfWLU=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.2 h1:pi0Skl6mNl2w8qWZXcdOyg197Zsf4G97U7Sso9JXGZE=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.2/go.mod h1:JYzLoEVeLXk+L4tn1+rrkfhkxl6mLDEVaDSvGq9og90=
-github.com/aws/aws-sdk-go-v2/service/sts v1.28.6 h1:cwIxeBttqPN3qkaAjcEcsh8NYr8n2HZPkcKgPAi1phU=
-github.com/aws/aws-sdk-go-v2/service/sts v1.28.6/go.mod h1:FZf1/nKNEkHdGGJP/cI2MoIMquumuRK6ol3QQJNDxmw=
-github.com/aws/smithy-go v1.20.2 h1:tbp628ireGtzcHDDmLT/6ADHidqnwgF57XOXZe6tp4Q=
-github.com/aws/smithy-go v1.20.2/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E=
+github.com/aws/aws-sdk-go-v2/service/sts v1.30.3 h1:ZsDKRLXGWHk8WdtyYMoGNO7bTudrvuKpDKgMVRlepGE=
+github.com/aws/aws-sdk-go-v2/service/sts v1.30.3/go.mod h1:zwySh8fpFyXp9yOr/KVzxOl8SRqgf/IDw5aUt9UKFcQ=
+github.com/aws/smithy-go v1.20.3 h1:ryHwveWzPV5BIof6fyDvor6V3iUL7nTfiTKXHiW05nE=
+github.com/aws/smithy-go v1.20.3/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E=
github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o=
github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932/go.mod h1:NOuUCSz6Q9T7+igc/hlvDOUdtWKryOrtFyIVABv/p7k=
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
-github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
+github.com/boombuler/barcode v1.0.2/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
github.com/campoy/embedmd v1.0.0 h1:V4kI2qTJJLf4J29RzI/MAt2c3Bl4dQSYPuflzwFH2hY=
github.com/campoy/embedmd v1.0.0/go.mod h1:oxyr9RCiSXg0M3VJ3ks0UGfp98BpSSGr0kpiX3MzVl8=
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
@@ -249,14 +258,11 @@ github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMr
github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
-github.com/chromedp/cdproto v0.0.0-20230802225258-3cf4e6d46a89/go.mod h1:GKljq0VrfU4D5yc+2qA6OVr8pmO/MBbPEWqWQ/oqGEs=
-github.com/chromedp/chromedp v0.9.2/go.mod h1:LkSXJKONWTCHAfQasKFUZI+mxqS4tZqhmtGzzhLsnLs=
-github.com/chromedp/sysutil v1.0.0/go.mod h1:kgWmDdq8fTzXYcKIBqIYvRRTnYb9aNS9moAV0xufSww=
github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ=
github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk=
github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8=
-github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b h1:ga8SEFjZ60pxLcmhnThWgvH2wg8376yUJmPhEH4H3kw=
-github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8=
+github.com/cncf/xds/go v0.0.0-20240723142845-024c85f92f20 h1:N+3sFI5GUjRKBi+i0TxYVST9h4Ie192jJWpHvthBBgg=
+github.com/cncf/xds/go v0.0.0-20240723142845-024c85f92f20/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8=
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.21 h1:1/QdRyBaHHJP61QkWMXlOIBfsgdDeeKfK8SYVUWJKf0=
github.com/creack/pty v1.1.21/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
@@ -269,8 +275,8 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cu
github.com/disintegration/gift v1.2.1/go.mod h1:Jh2i7f7Q2BM7Ezno3PhfezbR1xpUg9dUg3/RlKGr4HI=
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
-github.com/emicklei/go-restful/v3 v3.12.0 h1:y2DdzBAURM29NFF94q6RaY4vjIH1rtwDapwQtU84iWk=
-github.com/emicklei/go-restful/v3 v3.12.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
+github.com/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU=
+github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/envoyproxy/go-control-plane v0.12.0 h1:4X+VP1GHd1Mhj6IB5mMeGbLCleqxjletLK6K0rbxyZI=
github.com/envoyproxy/go-control-plane v0.12.0/go.mod h1:ZBTaoJ23lqITozF0M6G4/IragXCQKCnYbmlmtHvwRG0=
github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A=
@@ -301,19 +307,19 @@ github.com/fyne-io/mobile v0.1.2/go.mod h1:/kOrWrZB6sasLbEy2JIvr4arEzQTXBTZGb3Y9
github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk=
github.com/go-errors/errors v1.5.1 h1:ZwEMSLRCapFLflTpT7NKaAc7ukJ8ZPEjzlxt8rPN8bk=
github.com/go-errors/errors v1.5.1/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
-github.com/go-fonts/dejavu v0.3.3 h1:YZxbkwCBqVC0BojBvGdDdQuDqtm0oRs95eGhSPYbTvg=
-github.com/go-fonts/dejavu v0.3.3/go.mod h1:EpsVvJxpY/lRM2MbkThHF/5161F8YZdBFIC9uT3/Uqc=
-github.com/go-fonts/latin-modern v0.3.2 h1:M+Sq24Dp0ZRPf3TctPnG1MZxRblqyWC/cRUL9WmdaFc=
-github.com/go-fonts/latin-modern v0.3.2/go.mod h1:9odJt4NbRrbdj4UAMuLVd4zEukf6aAEKnDaQga0whqQ=
-github.com/go-fonts/liberation v0.3.2 h1:XuwG0vGHFBPRRI8Qwbi5tIvR3cku9LUfZGq/Ar16wlQ=
-github.com/go-fonts/liberation v0.3.2/go.mod h1:N0QsDLVUQPy3UYg9XAc3Uh3UDMp2Z7M1o4+X98dXkmI=
+github.com/go-fonts/dejavu v0.3.4 h1:Qqyx9IOs5CQFxyWTdvddeWzrX0VNwUAvbmAzL0fpjbc=
+github.com/go-fonts/dejavu v0.3.4/go.mod h1:D1z0DglIz+lmpeNYMYlxW4r22IhcdOYnt+R3PShU/Kg=
+github.com/go-fonts/latin-modern v0.3.3 h1:g2xNgI8yzdNzIVm+qvbMryB6yGPe0pSMss8QT3QwlJ0=
+github.com/go-fonts/latin-modern v0.3.3/go.mod h1:tHaiWDGze4EPB0Go4cLT5M3QzRY3peya09Z/8KSCrpY=
+github.com/go-fonts/liberation v0.3.3 h1:tM/T2vEOhjia6v5krQu8SDDegfH1SfXVRUNNKpq0Usk=
+github.com/go-fonts/liberation v0.3.3/go.mod h1:eUAzNRuJnpSnd1sm2EyloQfSOT79pdw7X7++Ri+3MCU=
github.com/go-fonts/stix v0.2.2/go.mod h1:SUxggC9dxd/Q+rb5PkJuvfvTbOPtNc2Qaua00fIp9iU=
github.com/go-gl/gl v0.0.0-20231021071112-07e5d0ea2e71/go.mod h1:9YTyiznxEY1fVinfM7RvRcjRHbw2xLBJ3AAGIT0I4Nw=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20240506104042-037f3cc74f2a/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
-github.com/go-latex/latex v0.0.0-20231108140139-5c1ce85aa4ea h1:DfZQkvEbdmOe+JK2TMtBM+0I9GSdzE2y/L1/AmD8xKc=
-github.com/go-latex/latex v0.0.0-20231108140139-5c1ce85aa4ea/go.mod h1:Y7Vld91/HRbTBm7JwoI7HejdDB0u+e9AUBO9MB7yuZk=
-github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
-github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
+github.com/go-latex/latex v0.0.0-20240709081214-31cef3c7570e h1:xcdj0LWnMSIU1j8+jIeJyfvk6SjgJedFQssSqFthJ2E=
+github.com/go-latex/latex v0.0.0-20240709081214-31cef3c7570e/go.mod h1:J4SAGzkcl+28QWi7yz72tyC/4aGnppOvya+AEv4TaAQ=
+github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ=
@@ -330,7 +336,7 @@ github.com/go-pdf/fpdf v1.4.3/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhO
github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
-github.com/go-playground/validator/v10 v10.20.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
+github.com/go-playground/validator/v10 v10.22.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI=
github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo=
github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y=
@@ -349,12 +355,9 @@ github.com/go-toolsmith/astequal v1.2.0 h1:3Fs3CYZ1k9Vo4FzFhwwewC3CHISHDnVUPC4x0
github.com/go-toolsmith/astequal v1.2.0/go.mod h1:c8NZ3+kSFtFY/8lPso4v8LuJjdJiUFVnSuU3s0qrrDY=
github.com/go-toolsmith/strparse v1.1.0 h1:GAioeZUK9TGxnLS+qfdqNbA4z0SSm5zVNtCQiyP2Bvw=
github.com/go-toolsmith/strparse v1.1.0/go.mod h1:7ksGy58fsaQkGQlY8WVoBFNyEPMGuJin1rfoPS4lBSQ=
-github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM=
-github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
-github.com/gobwas/ws v1.4.0/go.mod h1:G3gNqMNtPppf5XUz7O4shetPpcZ1VJ7zt18dlUeakrc=
github.com/goccmack/gocc v0.0.0-20230228185258-2292f9e40198/go.mod h1:DTh/Y2+NbnOVVoypCCQrovMPDKUGp4yZpSbWg5D0XIM=
-github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
-github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
+github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA=
+github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
github.com/goccy/go-yaml v1.9.8/go.mod h1:JubOolP3gh0HpiBc4BLRD4YmjEjHAmIIB2aaXKkTfoE=
github.com/goccy/go-yaml v1.11.0/go.mod h1:H+mJrWtjPTJAHvRbV09MCK9xYwODM+wRTVFFTWckfng=
github.com/gocql/gocql v1.6.0 h1:IdFdOTbnpbd0pDhl4REKQDM+Q0SzKXQ1Yh+YZZ8T/qU=
@@ -372,7 +375,7 @@ github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei
github.com/golang-sql/sqlexp v0.1.0/go.mod h1:J4ad9Vo8ZCWQ2GMrC4UCQy1JpCbwU9m3EOqtpKwwwHI=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
-github.com/golang/glog v1.2.1/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w=
+github.com/golang/glog v1.2.2/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
@@ -388,18 +391,16 @@ github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYu
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-pkcs11 v0.2.1-0.20230907215043-c6f79328ddf9/go.mod h1:6eQoGcuNJpa7jnd5pMGdkSaQpNDYvPlXWMcjXXThLlY=
-github.com/google/go-replayers/grpcreplay v1.1.0 h1:S5+I3zYyZ+GQz68OfbURDdt/+cSMqCK1wrvNx7WBzTE=
-github.com/google/go-replayers/grpcreplay v1.1.0/go.mod h1:qzAvJ8/wi57zq7gWqaE6AwLM6miiXUQwP1S+I9icmhk=
+github.com/google/go-replayers/grpcreplay v1.3.0 h1:1Keyy0m1sIpqstQmgz307zhiJ1pV4uIlFds5weTmxbo=
+github.com/google/go-replayers/grpcreplay v1.3.0/go.mod h1:v6NgKtkijC0d3e3RW8il6Sy5sqRVUwoQa4mHOGEy8DI=
github.com/google/go-replayers/httpreplay v1.2.0 h1:VM1wEyyjaoU53BwrOnaf9VhAyQQEEioJvFYxYcLRKzk=
github.com/google/go-replayers/httpreplay v1.2.0/go.mod h1:WahEFFZZ7a1P4VM1qEeHy+tME4bwyqPcwWbNlUI1Mcg=
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc=
github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0=
-github.com/google/pprof v0.0.0-20240507183855-6f11f98ebb1c h1:GCixZ7sgey01Kjw8pxBzCD0uVrubxl8SRzRgI0jwP+A=
-github.com/google/pprof v0.0.0-20240507183855-6f11f98ebb1c/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw=
-github.com/google/s2a-go v0.1.0/go.mod h1:OJpEgntRZo8ugHpF9hkoLJbS5dSI20XZeXJ9JVywLlM=
-github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A=
+github.com/google/pprof v0.0.0-20240722153945-304e4f0156b8 h1:ssNFCCVmib/GQSzx3uCWyfMgOamLGWuGqlMS77Y1m3Y=
+github.com/google/pprof v0.0.0-20240722153945-304e4f0156b8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo=
github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o=
github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
@@ -409,29 +410,28 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/wire v0.6.0 h1:HBkoIh4BdSxoyo9PveV8giw7ZsaBOvzWKfcg/6MrVwI=
github.com/google/wire v0.6.0/go.mod h1:F4QhpQ9EDIdJ1Mbop/NZBRB+5yrR6qg3BnctaoUk6NA=
-github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg=
-github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k=
-github.com/googleapis/enterprise-certificate-proxy v0.2.4/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k=
github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs=
github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0=
-github.com/googleapis/gax-go/v2 v2.12.4 h1:9gWcmF85Wvq4ryPFvGFaOgPIs1AQX0d0bcbGw4Z96qg=
-github.com/googleapis/gax-go/v2 v2.12.4/go.mod h1:KYEYLorsnIGDi/rPC8b5TdlB9kbKoFubselGIoBMCwI=
+github.com/googleapis/gax-go/v2 v2.13.0 h1:yitjD5f7jQHhyDsnhKEBU52NdvvdSeGzlAnDPT0hH1s=
+github.com/googleapis/gax-go/v2 v2.13.0/go.mod h1:Z/fvTZXF8/uw7Xu5GuslPw+bplx6SS338j1Is2S+B7A=
github.com/googleapis/google-cloud-go-testing v0.0.0-20210719221736-1c9a4c676720/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
github.com/gopherjs/gopherjs v0.0.0-20211219123610-ec9572f70e60/go.mod h1:cz9oNYuRUWGdHmLF2IodMLkAhcPtXeULvcBNagUrxTI=
github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k=
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
-github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
+github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
+github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/goxjs/gl v0.0.0-20210104184919-e3fafc6f8f2a/go.mod h1:dy/f2gjY09hwVfIyATps4G2ai7/hLwLkc5TrPqONuXY=
github.com/goxjs/glfw v0.0.0-20191126052801-d2efb5f20838/go.mod h1:oS8P8gVOT4ywTcjV6wZlOU4GuVFQ8F5328KY3MJ79CY=
+github.com/grafana/pyroscope-go/godeltaprof v0.1.7 h1:C11j63y7gymiW8VugJ9ZW0pWfxTZugdSJyC48olk5KY=
+github.com/grafana/pyroscope-go/godeltaprof v0.1.7/go.mod h1:Tk376Nbldo4Cha9RgiU7ik8WKFkNpfds98aUzS8omLE=
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA=
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
-github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 h1:/c3QmbOGMGTOumP2iT/rCwB7b0QDGLKzqOmktBjT+Is=
-github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1/go.mod h1:5SN9VR2LTsRFsrEC6FHgRbTWrTHu6tqPeKxEQv15giM=
+github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0=
+github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k=
github.com/hamba/avro/v2 v2.17.2/go.mod h1:Q9YK+qxAhtVrNqOhwlZTATLgLA8qxG2vtvkhK8fJ7Jo=
-github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
-github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
+github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY=
+github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
github.com/ianlancetaylor/demangle v0.0.0-20240312041847-bd984b5ce465/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw=
@@ -441,8 +441,9 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/jackmordaunt/icns v0.0.0-20181231085925-4f16af745526/go.mod h1:UQkeMHVoNcyXYq9otUupF7/h/2tmHlhrS2zw7ZVvUqc=
github.com/jackmordaunt/icns/v2 v2.2.1/go.mod h1:6aYIB9eSzyfHHMKqDf17Xrs1zetQPReAkiUSHzdw4cI=
-github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4=
+github.com/jessevdk/go-flags v1.6.1/go.mod h1:Mk8T1hIAWpOiJiHa9rJASDK2UGWji0EuPGBnNLMooyc=
github.com/jezek/xgb v1.0.0/go.mod h1:nrhwO0FX/enq75I7Y7G8iN1ubpSGZEiA3v9e9GyRFlk=
+github.com/jezek/xgb v1.1.1/go.mod h1:nrhwO0FX/enq75I7Y7G8iN1ubpSGZEiA3v9e9GyRFlk=
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
@@ -462,10 +463,10 @@ github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:C
github.com/kisielk/errcheck v1.7.0/go.mod h1:1kLL+jV4e+CFfueBmI1dSK2ADDyQnlrnrY/FqKluHJQ=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE=
-github.com/klauspost/compress v1.17.9-0.20240412100233-8bd3916ec655 h1:8Wwu7TntAfVPzPYVkCUGw5YrA8ohgXPg9nJTtk/VbA8=
-github.com/klauspost/compress v1.17.9-0.20240412100233-8bd3916ec655/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
-github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM=
-github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
+github.com/klauspost/compress v1.17.10-0.20240719110028-cfab8bd586ec h1:S0mztzoHWmIpI4VuqO7MPIf3DQQxWwW5e3Uurb+HMHA=
+github.com/klauspost/compress v1.17.10-0.20240719110028-cfab8bd586ec/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
+github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS5BM=
+github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
github.com/kpango/fastime v1.1.9 h1:xVQHcqyPt5M69DyFH7g1EPRns1YQNap9d5eLhl/Jy84=
github.com/kpango/fastime v1.1.9/go.mod h1:vyD7FnUn08zxY4b/QFBZVG+9EWMYsNl+QF0uE46urD4=
github.com/kpango/fuid v0.0.0-20221203053508-503b5ad89aa1 h1:rxyM+7uaZQ35P9fbixdnld/h4AgEhODoubuy6A4nDdk=
@@ -485,7 +486,6 @@ github.com/kubernetes-csi/external-snapshotter/client/v6 v6.3.0 h1:qS4r4ljINLWKJ
github.com/kubernetes-csi/external-snapshotter/client/v6 v6.3.0/go.mod h1:oGXx2XTEzs9ikW2V6IC1dD8trgjRsS/Mvc2JRiC618Y=
github.com/leanovate/gopter v0.2.11 h1:vRjThO1EKPb/1NsDXuDrzldR28RLkBflWYcU9CvzWu4=
github.com/leanovate/gopter v0.2.11/go.mod h1:aK3tzZP/C+p1m3SPRE4SYZFGP7jjkuSI4f7Xvpt0S9c=
-github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80/go.mod h1:imJHygn/1yfhB7XSJJKlFZKl/J+dCPAknuiaGOshXAs=
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
@@ -508,8 +508,8 @@ github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcs
github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE=
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
-github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8=
-github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c=
+github.com/moby/spdystream v0.4.0 h1:Vy79D6mHeJJjiPdFEL2yku1kl0chZpJfZcPpb16BRl8=
+github.com/moby/spdystream v0.4.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI=
github.com/moby/term v0.0.0-20221205130635-1aeaba878587 h1:HfkjXDfhgVaN5rmueG8cL8KKeFNecRCXFhaJ2qZ5SKA=
github.com/moby/term v0.0.0-20221205130635-1aeaba878587/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
@@ -530,11 +530,10 @@ github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY=
github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
-github.com/onsi/ginkgo/v2 v2.17.3 h1:oJcvKpIb7/8uLpDDtnQuf18xVnwKp8DTD7DQ6gTd/MU=
-github.com/onsi/ginkgo/v2 v2.17.3/go.mod h1:nP2DPOQoNsQmsVyv5rDA8JkXQoCs6goXIvr/PRJ1eCc=
+github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA=
+github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To=
github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk=
github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0=
-github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0=
github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY=
@@ -552,14 +551,14 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U=
-github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU=
-github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k=
+github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE=
+github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho=
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
-github.com/prometheus/common v0.53.0 h1:U2pL9w9nmJwJDa4qqLQ3ZaePJ6ZTwt7cMD3AG3+aLCE=
-github.com/prometheus/common v0.53.0/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U=
-github.com/prometheus/procfs v0.14.0 h1:Lw4VdGGoKEZilJsayHf0B+9YgLGREba2C6xr+Fdfq6s=
-github.com/prometheus/procfs v0.14.0/go.mod h1:XL+Iwz8k8ZabyZfMFHPiilCniixqQarAy5Mu67pHlNQ=
+github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc=
+github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8=
+github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
+github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
github.com/quasilyte/go-ruleguard v0.4.2 h1:htXcXDK6/rO12kiTHKfHuqR4kr3Y4M0J0rOL6CH/BYs=
github.com/quasilyte/go-ruleguard v0.4.2/go.mod h1:GJLgqsLeo4qgavUoL8JeGFNS7qcisx3awV/w9eWTmNI=
github.com/quasilyte/go-ruleguard/dsl v0.3.22 h1:wd8zkOhSNr+I+8Qeciml08ivDt1pSXe60+5DqOpCjPE=
@@ -590,8 +589,8 @@ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVs
github.com/smarty/assertions v1.15.0/go.mod h1:yABtdzeQs6l1brC900WlRNwj6ZR55d7B+E8C6HtKdec=
github.com/smartystreets/goconvey v1.8.1/go.mod h1:+/u4qLyY6x1jReYOp7GOM2FSt8aP9CzCZL03bI28W60=
github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY=
-github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
-github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
+github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=
+github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/srwiley/oksvg v0.0.0-20200311192757-870daf9aa564/go.mod h1:afMbS0qvv1m5tfENCwnOdZGOF8RGR/FsZ7bvBxQGZG4=
@@ -623,32 +622,32 @@ go.etcd.io/bbolt v1.3.10 h1:+BqfJTcCzTItrop8mq/lbzL8wSGtj94UO/3U31shqG0=
go.etcd.io/bbolt v1.3.10/go.mod h1:bK3UQLPJZly7IlNmV7uVHJDxfe5aK9Ll93e/74Y9oEQ=
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0 h1:A3SayB3rNyt+1S6qpI9mHPkeHTZbD7XILEqWnYZb2l0=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0/go.mod h1:27iA5uvhuRNmalO+iEUdVn5ZMj2qy10Mm+XRIpRmyuU=
+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 h1:9G6E0TXzGFVfTnawRzrPl83iHOAV7L8NJiR8RSGYV1g=
+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0/go.mod h1:azvtTADFQJA8mX80jIH/akaE7h+dbm/sVuaHqN13w74=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0/go.mod h1:SK2UL73Zy1quvRPonmOmRDiWk1KBV3LyIeeIxcEApWw=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0/go.mod h1:rdENBZMT2OE6Ne/KLwpiXudnAsbdrdBaqBvTN8M8BgA=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw=
-go.opentelemetry.io/otel v1.26.0 h1:LQwgL5s/1W7YiiRwxf03QGnWLb2HW4pLiAhaA5cZXBs=
-go.opentelemetry.io/otel v1.26.0/go.mod h1:UmLkJHUAidDval2EICqBMbnAd0/m2vmpf/dAM+fvFs4=
-go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.26.0 h1:+hm+I+KigBy3M24/h1p/NHkUx/evbLH0PNcjpMyCHc4=
-go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.26.0/go.mod h1:NjC8142mLvvNT6biDpaMjyz78kyEHIwAJlSX0N9P5KI=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0 h1:1u/AyyOqAWzy+SkPxDpahCNZParHV8Vid1RnI2clyDE=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0/go.mod h1:z46paqbJ9l7c9fIPCXTqTGwhQZ5XoTIsfeFYWboizjs=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.26.0 h1:Waw9Wfpo/IXzOI8bCB7DIk+0JZcqqsyn1JFnAc+iam8=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.26.0/go.mod h1:wnJIG4fOqyynOnnQF/eQb4/16VlX2EJAHhHgqIqWfAo=
-go.opentelemetry.io/otel/metric v1.26.0 h1:7S39CLuY5Jgg9CrnA9HHiEjGMF/X2VHvoXGgSllRz30=
-go.opentelemetry.io/otel/metric v1.26.0/go.mod h1:SY+rHOI4cEawI9a7N1A4nIg/nTQXe1ccCNWYOJUrpX4=
-go.opentelemetry.io/otel/sdk v1.26.0 h1:Y7bumHf5tAiDlRYFmGqetNcLaVUZmh4iYfmGxtmz7F8=
-go.opentelemetry.io/otel/sdk v1.26.0/go.mod h1:0p8MXpqLeJ0pzcszQQN4F0S5FVjBLgypeGSngLsmirs=
-go.opentelemetry.io/otel/sdk/metric v1.26.0 h1:cWSks5tfriHPdWFnl+qpX3P681aAYqlZHcAyHw5aU9Y=
-go.opentelemetry.io/otel/sdk/metric v1.26.0/go.mod h1:ClMFFknnThJCksebJwz7KIyEDHO+nTB6gK8obLy8RyE=
-go.opentelemetry.io/otel/trace v1.26.0 h1:1ieeAUb4y0TE26jUFrCIXKpTuVK7uJGN9/Z/2LP5sQA=
-go.opentelemetry.io/otel/trace v1.26.0/go.mod h1:4iDxvGDQuUkHve82hJJ8UqrwswHYsZuWCBllGV2U2y0=
-go.opentelemetry.io/proto/otlp v1.2.0 h1:pVeZGk7nXDC9O2hncA6nHldxEjm6LByfA2aN8IOkz94=
-go.opentelemetry.io/proto/otlp v1.2.0/go.mod h1:gGpR8txAl5M03pDhMC79G6SdqNV26naRm/KDsgaHD8A=
-go.starlark.net v0.0.0-20240507195648-35fe9f26b4bc h1:WMJEq47tB89BoJ5HUfoMZVtN+0u6f32LgIfQlu3mMF8=
-go.starlark.net v0.0.0-20240507195648-35fe9f26b4bc/go.mod h1:YKMCv9b1WrfWmeqdV5MAuEHWsu5iC+fe6kYl2sQjdI8=
+go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo=
+go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4=
+go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0 h1:U2guen0GhqH8o/G2un8f/aG/y++OuW6MyCo6hT9prXk=
+go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0/go.mod h1:yeGZANgEcpdx/WK0IvvRFC+2oLiMS2u4L/0Rj2M2Qr0=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 h1:3Q/xZUyC1BBkualc9ROb4G8qkH90LXEIICcs5zv1OYY=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0/go.mod h1:s75jGIWA9OfCMzF0xr+ZgfrB5FEbbV7UuYo32ahUiFI=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 h1:R3X6ZXmNPRR8ul6i3WgFURCHzaXjHdm0karRG/+dj3s=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0/go.mod h1:QWFXnDavXWwMx2EEcZsf3yxgEKAqsxQ+Syjp+seyInw=
+go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q=
+go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s=
+go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE=
+go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg=
+go.opentelemetry.io/otel/sdk/metric v1.28.0 h1:OkuaKgKrgAbYrrY0t92c+cC+2F6hsFNnCQArXCKlg08=
+go.opentelemetry.io/otel/sdk/metric v1.28.0/go.mod h1:cWPjykihLAPvXKi4iZc1dpER3Jdq2Z0YLse3moQUCpg=
+go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g=
+go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI=
+go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0=
+go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8=
+go.starlark.net v0.0.0-20240705175910-70002002b310 h1:tEAOMoNmN2MqVNi0MMEWpTtPI4YNCXgxmAGtuv3mST0=
+go.starlark.net v0.0.0-20240705175910-70002002b310/go.mod h1:YKMCv9b1WrfWmeqdV5MAuEHWsu5iC+fe6kYl2sQjdI8=
go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8=
@@ -663,40 +662,41 @@ go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
gocloud.dev v0.37.0 h1:XF1rN6R0qZI/9DYjN16Uy0durAmSlf58DHOcb28GPro=
gocloud.dev v0.37.0/go.mod h1:7/O4kqdInCNsc6LqgmuFnS0GRew4XNNYWpA44yQnwco=
-golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
-golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
-golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM=
-golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc=
+golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30=
+golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
+golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8=
+golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY=
golang.org/x/exp/shiny v0.0.0-20220827204233-334a2380cb91/go.mod h1:VjAR7z0ngyATZTELrBSkxOOHhhlnVUxDye4mcjx5h/8=
golang.org/x/exp/shiny v0.0.0-20230801115018-d63ba01acd4b/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0=
golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0=
-golang.org/x/exp/typeparams v0.0.0-20240506185415-9bf2ced13842 h1:S62OJe0/hUkTgveY1HXZMHWBOy21DVrobMYz2cMCO64=
-golang.org/x/exp/typeparams v0.0.0-20240506185415-9bf2ced13842/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk=
-golang.org/x/image v0.16.0 h1:9kloLAKhUufZhA12l5fwnx2NZW39/we1UhBesW433jw=
-golang.org/x/image v0.16.0/go.mod h1:ugSZItdV4nOxyqp56HmXwH0Ry0nBCpjnZdpDaIHdoPs=
+golang.org/x/exp/shiny v0.0.0-20240707233637-46b078467d37/go.mod h1:3F+MieQB7dRYLTmnncoFbb1crS5lfQoTfDgQy6K4N0o=
+golang.org/x/exp/typeparams v0.0.0-20240719175910-8a7402abbf56 h1:i+QrZdyNyfLEnWjd5T6LQZvQP3xk2XiNs3sQgN7QDGE=
+golang.org/x/exp/typeparams v0.0.0-20240719175910-8a7402abbf56/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk=
+golang.org/x/image v0.18.0 h1:jGzIakQa/ZXI1I0Fxvaa9W7yP25TqT6cHIHn+6CqvSQ=
+golang.org/x/image v0.18.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E=
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
-golang.org/x/mobile v0.0.0-20240506190922-a1a533f289d3/go.mod h1:EiXZlVfUTaAyySFVJb9rsODuiO+WXu8HrUuySb7nYFw=
-golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=
-golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
-golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
-golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
-golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo=
-golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
+golang.org/x/mobile v0.0.0-20240716161057-1ad2df20a8b6/go.mod h1:TCsc78+c4cqb8IKEosz2LwJ6YRNkIjMuAYeHYjchGDE=
+golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8=
+golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
+golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
+golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
+golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs=
+golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
-golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
-golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
-golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw=
-golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
-golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
-golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
+golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457/go.mod h1:pRgIJT+bRLFKnoM1ldnzKoxTIn14Yxz928LQRYYgIN0=
+golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk=
+golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4=
+golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
+golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
-golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw=
-golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
-golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU=
-golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
+golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg=
+golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI=
+golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 h1:LLhsEBxRTBLuKlQxFBYUOU8xyFgXv6cOTp2HASDlsDk=
+golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw=
gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
gonum.org/v1/gonum v0.15.0 h1:2lYxjRbTYyxkJxlhC+LvJIx3SsANPdRybu1tGj9/OrQ=
@@ -705,20 +705,20 @@ gonum.org/v1/hdf5 v0.0.0-20210714002203-8c5d23bc6946 h1:vJpL69PeUullhJyKtTjHjENE
gonum.org/v1/hdf5 v0.0.0-20210714002203-8c5d23bc6946/go.mod h1:BQUWDHIAygjdt1HnUPQ0eWqLN2n5FwJycrpYUVUOx2I=
gonum.org/v1/plot v0.14.0 h1:+LBDVFYwFe4LHhdP8coW6296MBEY4nQ+Y4vuUpJopcE=
gonum.org/v1/plot v0.14.0/go.mod h1:MLdR9424SJed+5VqC6MsouEpig9pZX2VZ57H9ko2bXU=
-google.golang.org/api v0.178.0 h1:yoW/QMI4bRVCHF+NWOTa4cL8MoWL3Jnuc7FlcFF91Ok=
-google.golang.org/api v0.178.0/go.mod h1:84/k2v8DFpDRebpGcooklv/lais3MEfqpaBLA12gl2U=
+google.golang.org/api v0.189.0 h1:equMo30LypAkdkLMBqfeIqtyAnlyig1JSZArl4XPwdI=
+google.golang.org/api v0.189.0/go.mod h1:FLWGJKb0hb+pU2j+rJqwbnsF+ym+fQs73rbJ+KAUgy8=
google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds=
-google.golang.org/genproto v0.0.0-20240506185236-b8a5c65736ae h1:HjgkYCl6cWQEKSHkpUp4Q8VB74swzyBwTz1wtTzahm0=
-google.golang.org/genproto v0.0.0-20240506185236-b8a5c65736ae/go.mod h1:i4np6Wrjp8EujFAUn0CM0SH+iZhY1EbrfzEIJbFkHFM=
-google.golang.org/genproto/googleapis/api v0.0.0-20240506185236-b8a5c65736ae h1:AH34z6WAGVNkllnKs5raNq3yRq93VnjBG6rpfub/jYk=
-google.golang.org/genproto/googleapis/api v0.0.0-20240506185236-b8a5c65736ae/go.mod h1:FfiGhwUm6CJviekPrc0oJ+7h29e+DmWU6UtjX0ZvI7Y=
-google.golang.org/genproto/googleapis/bytestream v0.0.0-20240429193739-8cf5692501f6/go.mod h1:ULqtoQMxDLNRfW+pJbKA68wtIy1OiYjdIsJs3PMpzh8=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20240506185236-b8a5c65736ae h1:c55+MER4zkBS14uJhSZMGGmya0yJx5iHV4x/fpOSNRk=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20240506185236-b8a5c65736ae/go.mod h1:I7Y+G38R2bu5j1aLzfFmQfTcU/WnFuqDwLZAbvKTKpM=
-google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM=
-google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA=
-google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg=
-google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+google.golang.org/genproto v0.0.0-20240723171418-e6d459c13d2a h1:hPbLwHFm59QoSKUT0uGaL19YN4U9W5lY4+iNXlUBNj0=
+google.golang.org/genproto v0.0.0-20240723171418-e6d459c13d2a/go.mod h1:+7gIV7FP6jBo5hiY2lsWA//NkNORQVj0J1Isc/4HzR4=
+google.golang.org/genproto/googleapis/api v0.0.0-20240723171418-e6d459c13d2a h1:YIa/rzVqMEokBkPtydCkx1VLmv3An1Uw7w1P1m6EhOY=
+google.golang.org/genproto/googleapis/api v0.0.0-20240723171418-e6d459c13d2a/go.mod h1:AHT0dDg3SoMOgZGnZk29b5xTbPHMoEC8qthmBLJCpys=
+google.golang.org/genproto/googleapis/bytestream v0.0.0-20240722135656-d784300faade/go.mod h1:5/MT647Cn/GGhwTpXC7QqcaR5Cnee4v4MKCU1/nwnIQ=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240723171418-e6d459c13d2a h1:hqK4+jJZXCU4pW7jsAdGOVFIfLHQeV7LaizZKnZ84HI=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240723171418-e6d459c13d2a/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY=
+google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc=
+google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ=
+google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
+google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
@@ -732,24 +732,24 @@ gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=
honnef.co/go/js/dom v0.0.0-20210725211120-f030747120f2/go.mod h1:sUMDUKNB2ZcVjt92UnLy3cdGs+wDAcrPdV3JP6sVgA4=
honnef.co/go/tools v0.4.7/go.mod h1:+rnGS1THNh8zMwnd2oVOTL9QF6vmfyG6ZXBULae2uc0=
-k8s.io/api v0.30.0 h1:siWhRq7cNjy2iHssOB9SCGNCl2spiF1dO3dABqZ8niA=
-k8s.io/api v0.30.0/go.mod h1:OPlaYhoHs8EQ1ql0R/TsUgaRPhpKNxIMrKQfWUp8QSE=
-k8s.io/apiextensions-apiserver v0.30.0 h1:jcZFKMqnICJfRxTgnC4E+Hpcq8UEhT8B2lhBcQ+6uAs=
-k8s.io/apiextensions-apiserver v0.30.0/go.mod h1:N9ogQFGcrbWqAY9p2mUAL5mGxsLqwgtUce127VtRX5Y=
-k8s.io/apimachinery v0.30.0 h1:qxVPsyDM5XS96NIh9Oj6LavoVFYff/Pon9cZeDIkHHA=
-k8s.io/apimachinery v0.30.0/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc=
-k8s.io/cli-runtime v0.30.0 h1:0vn6/XhOvn1RJ2KJOC6IRR2CGqrpT6QQF4+8pYpWQ48=
-k8s.io/cli-runtime v0.30.0/go.mod h1:vATpDMATVTMA79sZ0YUCzlMelf6rUjoBzlp+RnoM+cg=
-k8s.io/client-go v0.30.0 h1:sB1AGGlhY/o7KCyCEQ0bPWzYDL0pwOZO4vAtTSh/gJQ=
-k8s.io/client-go v0.30.0/go.mod h1:g7li5O5256qe6TYdAMyX/otJqMhIiGgTapdLchhmOaY=
-k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw=
-k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
-k8s.io/kube-openapi v0.0.0-20240430033511-f0e62f92d13f h1:0LQagt0gDpKqvIkAMPaRGcXawNMouPECM1+F9BVxEaM=
-k8s.io/kube-openapi v0.0.0-20240430033511-f0e62f92d13f/go.mod h1:S9tOR0FxgyusSNR+MboCuiDpVWkAifZvaYI1Q2ubgro=
-k8s.io/metrics v0.30.0 h1:tqB+T0GJY288KahaO3Eb41HaDVeLR18gBmyPo0R417s=
-k8s.io/metrics v0.30.0/go.mod h1:nSDA8V19WHhCTBhRYuyzJT9yPJBxSpqbyrGCCQ4jPj4=
-k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 h1:jgGTlFYnhF1PM1Ax/lAlxUPE+KfCIXHaathvJg1C3ak=
-k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
+k8s.io/api v0.30.2 h1:+ZhRj+28QT4UOH+BKznu4CBgPWgkXO7XAvMcMl0qKvI=
+k8s.io/api v0.30.2/go.mod h1:ULg5g9JvOev2dG0u2hig4Z7tQ2hHIuS+m8MNZ+X6EmI=
+k8s.io/apiextensions-apiserver v0.30.2 h1:l7Eue2t6QiLHErfn2vwK4KgF4NeDgjQkCXtEbOocKIE=
+k8s.io/apiextensions-apiserver v0.30.2/go.mod h1:lsJFLYyK40iguuinsb3nt+Sj6CmodSI4ACDLep1rgjw=
+k8s.io/apimachinery v0.30.2 h1:fEMcnBj6qkzzPGSVsAZtQThU62SmQ4ZymlXRC5yFSCg=
+k8s.io/apimachinery v0.30.2/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc=
+k8s.io/cli-runtime v0.30.2 h1:ooM40eEJusbgHNEqnHziN9ZpLN5U4WcQGsdLKVxpkKE=
+k8s.io/cli-runtime v0.30.2/go.mod h1:Y4g/2XezFyTATQUbvV5WaChoUGhojv/jZAtdp5Zkm0A=
+k8s.io/client-go v0.30.2 h1:sBIVJdojUNPDU/jObC+18tXWcTJVcwyqS9diGdWHk50=
+k8s.io/client-go v0.30.2/go.mod h1:JglKSWULm9xlJLx4KCkfLLQ7XwtlbflV6uFFSHTMgVs=
+k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
+k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
+k8s.io/kube-openapi v0.0.0-20240709000822-3c01b740850f h1:2sXuKesAYbRHxL3aE2PN6zX/gcJr22cjrsej+W784Tc=
+k8s.io/kube-openapi v0.0.0-20240709000822-3c01b740850f/go.mod h1:UxDHUPsUwTOOxSU+oXURfFBcAS6JwiRXTYqYwfuGowc=
+k8s.io/metrics v0.30.2 h1:zj4kIPTCfEbY0RHEogpA7QtlItU7xaO11+Gz1zVDxlc=
+k8s.io/metrics v0.30.2/go.mod h1:GpoO5XTy/g8CclVLtgA5WTrr2Cy5vCsqr5Xa/0ETWIk=
+k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A=
+k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk=
lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk=
lukechampine.com/uint128 v1.3.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk=
@@ -783,8 +783,8 @@ modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
modernc.org/z v1.7.0/go.mod h1:hVdgNMh8ggTuRG1rGU8x+xGRFfiQUIAw0ZqlPy8+HyQ=
rsc.io/pdf v0.1.1 h1:k1MczvYDUvJBe93bYd7wrZLLUEcLZAuF824/I4e5Xr4=
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
-sigs.k8s.io/controller-runtime v0.18.2 h1:RqVW6Kpeaji67CY5nPEfRz6ZfFMk0lWQlNrLqlNpx+Q=
-sigs.k8s.io/controller-runtime v0.18.2/go.mod h1:tuAt1+wbVsXIT8lPtk5RURxqAnq7xkpv2Mhttslg7Hw=
+sigs.k8s.io/controller-runtime v0.18.4 h1:87+guW1zhvuPLh1PHybKdYFLU0YJp4FhJRmiHvm5BZw=
+sigs.k8s.io/controller-runtime v0.18.4/go.mod h1:TVoGrfdpbA9VRFaRnKgk9P5/atA0pMwq+f+msb9M8Sg=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 h1:XX3Ajgzov2RKUdc5jW3t5jwY7Bo7dcRm+tFxT+NfgY0=
diff --git a/hack/benchmark/assets/x1b/loader.go b/hack/benchmark/assets/x1b/loader.go
index 54a51f3f81..ecb126bd9e 100644
--- a/hack/benchmark/assets/x1b/loader.go
+++ b/hack/benchmark/assets/x1b/loader.go
@@ -32,7 +32,7 @@ var (
)
type BillionScaleVectors interface {
- Load(i int) (interface{}, error)
+ Load(i int) (any, error)
Dimension() int
Size() int
Close() error
@@ -133,7 +133,7 @@ func (bv *bvecs) LoadUint8(i int) ([]uint8, error) {
return ((*[1 << 26]uint8)(unsafe.Pointer(&buf[0])))[:bv.dim:bv.dim], nil
}
-func (bv *bvecs) Load(i int) (interface{}, error) {
+func (bv *bvecs) Load(i int) (any, error) {
return bv.LoadUint8(i)
}
@@ -146,7 +146,7 @@ func (fv *fvecs) LoadFloat32(i int) ([]float32, error) {
return ((*[1 << 26]float32)(unsafe.Pointer(&buf[0])))[:fv.dim:fv.dim], nil
}
-func (fv *fvecs) Load(i int) (interface{}, error) {
+func (fv *fvecs) Load(i int) (any, error) {
return fv.LoadFloat32(i)
}
@@ -159,7 +159,7 @@ func (iv *ivecs) LoadInt32(i int) ([]int32, error) {
return ((*[1 << 26]int32)(unsafe.Pointer(&buf[0])))[:iv.dim:iv.dim], nil
}
-func (iv *ivecs) Load(i int) (interface{}, error) {
+func (iv *ivecs) Load(i int) (any, error) {
return iv.LoadInt32(i)
}
diff --git a/hack/benchmark/assets/x1b/loader_bench_test.go b/hack/benchmark/assets/x1b/loader_bench_test.go
index b570cd29f6..486e6d4054 100644
--- a/hack/benchmark/assets/x1b/loader_bench_test.go
+++ b/hack/benchmark/assets/x1b/loader_bench_test.go
@@ -13,9 +13,7 @@
// limitations under the License.
package x1b
-import (
- "testing"
-)
+import "testing"
const (
bvecsFile = "../large/sift1b/bigann_base.bvecs"
diff --git a/hack/benchmark/assets/x1b/loader_test.go b/hack/benchmark/assets/x1b/loader_test.go
index a9c184cb1d..f87e045f8c 100644
--- a/hack/benchmark/assets/x1b/loader_test.go
+++ b/hack/benchmark/assets/x1b/loader_test.go
@@ -637,7 +637,7 @@ package x1b
// file *file
// }
// type want struct {
-// want interface{}
+// want any
// err error
// }
// type test struct {
@@ -645,11 +645,11 @@ package x1b
// args args
// fields fields
// want want
-// checkFunc func(want, interface{}, error) error
+// checkFunc func(want, any, error) error
// beforeFunc func(*testing.T, args)
// afterFunc func(*testing.T, args)
// }
-// defaultCheckFunc := func(w want, got interface{}, err error) error {
+// defaultCheckFunc := func(w want, got any, err error) error {
// if !errors.Is(err, w.err) {
// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err)
// }
@@ -843,7 +843,7 @@ package x1b
// file *file
// }
// type want struct {
-// want interface{}
+// want any
// err error
// }
// type test struct {
@@ -851,11 +851,11 @@ package x1b
// args args
// fields fields
// want want
-// checkFunc func(want, interface{}, error) error
+// checkFunc func(want, any, error) error
// beforeFunc func(*testing.T, args)
// afterFunc func(*testing.T, args)
// }
-// defaultCheckFunc := func(w want, got interface{}, err error) error {
+// defaultCheckFunc := func(w want, got any, err error) error {
// if !errors.Is(err, w.err) {
// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err)
// }
@@ -1049,7 +1049,7 @@ package x1b
// file *file
// }
// type want struct {
-// want interface{}
+// want any
// err error
// }
// type test struct {
@@ -1057,11 +1057,11 @@ package x1b
// args args
// fields fields
// want want
-// checkFunc func(want, interface{}, error) error
+// checkFunc func(want, any, error) error
// beforeFunc func(*testing.T, args)
// afterFunc func(*testing.T, args)
// }
-// defaultCheckFunc := func(w want, got interface{}, err error) error {
+// defaultCheckFunc := func(w want, got any, err error) error {
// if !errors.Is(err, w.err) {
// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err)
// }
diff --git a/hack/benchmark/core/benchmark/strategy/bulk_insert.go b/hack/benchmark/core/benchmark/strategy/bulk_insert.go
index de5d820398..2c833bc923 100644
--- a/hack/benchmark/core/benchmark/strategy/bulk_insert.go
+++ b/hack/benchmark/core/benchmark/strategy/bulk_insert.go
@@ -34,7 +34,7 @@ func NewBulkInsert(opts ...StrategyOption) benchmark.Strategy {
return newStrategy(append([]StrategyOption{
WithPropName("BulkInsert"),
WithProp32(
- func(ctx context.Context, b *testing.B, c algorithm.Bit32, dataset assets.Dataset, ids []uint, cnt *uint64) (interface{}, error) {
+ func(ctx context.Context, b *testing.B, c algorithm.Bit32, dataset assets.Dataset, ids []uint, cnt *uint64) (any, error) {
size := func() int {
if maxBulkSize < dataset.TrainSize() {
return maxBulkSize
@@ -60,7 +60,7 @@ func NewBulkInsert(opts ...StrategyOption) benchmark.Strategy {
},
),
WithProp64(
- func(ctx context.Context, b *testing.B, c algorithm.Bit64, dataset assets.Dataset, ids []uint, cnt *uint64) (interface{}, error) {
+ func(ctx context.Context, b *testing.B, c algorithm.Bit64, dataset assets.Dataset, ids []uint, cnt *uint64) (any, error) {
size := func() int {
if maxBulkSize < dataset.TrainSize() {
return maxBulkSize
diff --git a/hack/benchmark/core/benchmark/strategy/bulk_insert_commit.go b/hack/benchmark/core/benchmark/strategy/bulk_insert_commit.go
index ba587dafc1..34e3bd0abd 100644
--- a/hack/benchmark/core/benchmark/strategy/bulk_insert_commit.go
+++ b/hack/benchmark/core/benchmark/strategy/bulk_insert_commit.go
@@ -30,7 +30,7 @@ func NewBulkInsertCommit(poolSize uint32, opts ...StrategyOption) benchmark.Stra
return newStrategy(append([]StrategyOption{
WithPropName("BulkInsertCommit"),
WithProp32(
- func(ctx context.Context, b *testing.B, c algorithm.Bit32, dataset assets.Dataset, ids []uint, cnt *uint64) (interface{}, error) {
+ func(ctx context.Context, b *testing.B, c algorithm.Bit32, dataset assets.Dataset, ids []uint, cnt *uint64) (any, error) {
size := func() int {
if maxBulkSize < dataset.TrainSize() {
return maxBulkSize
@@ -56,7 +56,7 @@ func NewBulkInsertCommit(poolSize uint32, opts ...StrategyOption) benchmark.Stra
},
),
WithProp64(
- func(ctx context.Context, b *testing.B, c algorithm.Bit64, dataset assets.Dataset, ids []uint, cnt *uint64) (interface{}, error) {
+ func(ctx context.Context, b *testing.B, c algorithm.Bit64, dataset assets.Dataset, ids []uint, cnt *uint64) (any, error) {
size := func() int {
if maxBulkSize < dataset.TrainSize() {
return maxBulkSize
diff --git a/hack/benchmark/core/benchmark/strategy/get_vector.go b/hack/benchmark/core/benchmark/strategy/get_vector.go
index a37f2c592f..b251a26e61 100644
--- a/hack/benchmark/core/benchmark/strategy/get_vector.go
+++ b/hack/benchmark/core/benchmark/strategy/get_vector.go
@@ -36,7 +36,7 @@ func NewGetVector(opts ...StrategyOption) benchmark.Strategy {
},
),
WithProp32(
- func(ctx context.Context, b *testing.B, c algorithm.Bit32, dataset assets.Dataset, ids []uint, cnt *uint64) (interface{}, error) {
+ func(ctx context.Context, b *testing.B, c algorithm.Bit32, dataset assets.Dataset, ids []uint, cnt *uint64) (any, error) {
return c.GetVector(ids[int(atomic.LoadUint64(cnt))%len(ids)])
},
),
@@ -46,7 +46,7 @@ func NewGetVector(opts ...StrategyOption) benchmark.Strategy {
},
),
WithProp64(
- func(ctx context.Context, b *testing.B, c algorithm.Bit64, dataset assets.Dataset, ids []uint, cnt *uint64) (interface{}, error) {
+ func(ctx context.Context, b *testing.B, c algorithm.Bit64, dataset assets.Dataset, ids []uint, cnt *uint64) (any, error) {
return c.GetVector(ids[int(atomic.LoadUint64(cnt))%len(ids)])
},
),
diff --git a/hack/benchmark/core/benchmark/strategy/insert.go b/hack/benchmark/core/benchmark/strategy/insert.go
index 85cadc1f4b..476f90e07b 100644
--- a/hack/benchmark/core/benchmark/strategy/insert.go
+++ b/hack/benchmark/core/benchmark/strategy/insert.go
@@ -31,7 +31,7 @@ func NewInsert(opts ...StrategyOption) benchmark.Strategy {
return newStrategy(append([]StrategyOption{
WithPropName("Insert"),
WithProp32(
- func(ctx context.Context, b *testing.B, c algorithm.Bit32, dataset assets.Dataset, ids []uint, cnt *uint64) (interface{}, error) {
+ func(ctx context.Context, b *testing.B, c algorithm.Bit32, dataset assets.Dataset, ids []uint, cnt *uint64) (any, error) {
v, err := dataset.Train(int(atomic.LoadUint64(cnt)) % dataset.TrainSize())
if err != nil {
return nil, err
@@ -42,7 +42,7 @@ func NewInsert(opts ...StrategyOption) benchmark.Strategy {
},
),
WithProp64(
- func(ctx context.Context, b *testing.B, c algorithm.Bit64, dataset assets.Dataset, ids []uint, cnt *uint64) (interface{}, error) {
+ func(ctx context.Context, b *testing.B, c algorithm.Bit64, dataset assets.Dataset, ids []uint, cnt *uint64) (any, error) {
v, err := dataset.Train(int(atomic.LoadUint64(cnt)) % dataset.TrainSize())
if err != nil {
return nil, err
diff --git a/hack/benchmark/core/benchmark/strategy/insert_commit.go b/hack/benchmark/core/benchmark/strategy/insert_commit.go
index 3314bfb096..dc0897fd4e 100644
--- a/hack/benchmark/core/benchmark/strategy/insert_commit.go
+++ b/hack/benchmark/core/benchmark/strategy/insert_commit.go
@@ -31,7 +31,7 @@ func NewInsertCommit(poolSize uint32, opts ...StrategyOption) benchmark.Strategy
return newStrategy(append([]StrategyOption{
WithPropName("InsertCommit"),
WithProp32(
- func(ctx context.Context, b *testing.B, c algorithm.Bit32, dataset assets.Dataset, ids []uint, cnt *uint64) (interface{}, error) {
+ func(ctx context.Context, b *testing.B, c algorithm.Bit32, dataset assets.Dataset, ids []uint, cnt *uint64) (any, error) {
v, err := dataset.Train(int(atomic.LoadUint64(cnt)) % dataset.TrainSize())
if err != nil {
return nil, err
@@ -42,7 +42,7 @@ func NewInsertCommit(poolSize uint32, opts ...StrategyOption) benchmark.Strategy
},
),
WithProp64(
- func(ctx context.Context, b *testing.B, c algorithm.Bit64, dataset assets.Dataset, ids []uint, cnt *uint64) (interface{}, error) {
+ func(ctx context.Context, b *testing.B, c algorithm.Bit64, dataset assets.Dataset, ids []uint, cnt *uint64) (any, error) {
v, err := dataset.Train(int(atomic.LoadUint64(cnt)) % dataset.TrainSize())
if err != nil {
return nil, err
diff --git a/hack/benchmark/core/benchmark/strategy/remove.go b/hack/benchmark/core/benchmark/strategy/remove.go
index effa4577a0..e0a4776744 100644
--- a/hack/benchmark/core/benchmark/strategy/remove.go
+++ b/hack/benchmark/core/benchmark/strategy/remove.go
@@ -36,7 +36,7 @@ func NewRemove(opts ...StrategyOption) benchmark.Strategy {
},
),
WithProp32(
- func(ctx context.Context, b *testing.B, c algorithm.Bit32, dataset assets.Dataset, ids []uint, cnt *uint64) (obj interface{}, err error) {
+ func(ctx context.Context, b *testing.B, c algorithm.Bit32, dataset assets.Dataset, ids []uint, cnt *uint64) (obj any, err error) {
err = c.Remove(ids[int(atomic.LoadUint64(cnt))%len(ids)])
return
},
@@ -47,7 +47,7 @@ func NewRemove(opts ...StrategyOption) benchmark.Strategy {
},
),
WithProp64(
- func(ctx context.Context, b *testing.B, c algorithm.Bit64, dataset assets.Dataset, ids []uint, cnt *uint64) (obj interface{}, err error) {
+ func(ctx context.Context, b *testing.B, c algorithm.Bit64, dataset assets.Dataset, ids []uint, cnt *uint64) (obj any, err error) {
err = c.Remove(ids[int(atomic.LoadUint64(cnt))%len(ids)])
return
},
diff --git a/hack/benchmark/core/benchmark/strategy/search.go b/hack/benchmark/core/benchmark/strategy/search.go
index fd6c090ffb..ecf3bda13a 100644
--- a/hack/benchmark/core/benchmark/strategy/search.go
+++ b/hack/benchmark/core/benchmark/strategy/search.go
@@ -36,7 +36,7 @@ func NewSearch(size int, epsilon, radius float32, opts ...StrategyOption) benchm
},
),
WithProp32(
- func(ctx context.Context, b *testing.B, c algorithm.Bit32, dataset assets.Dataset, ids []uint, cnt *uint64) (interface{}, error) {
+ func(ctx context.Context, b *testing.B, c algorithm.Bit32, dataset assets.Dataset, ids []uint, cnt *uint64) (any, error) {
v, err := dataset.Query(int(atomic.LoadUint64(cnt)) % dataset.TrainSize())
if err != nil {
return nil, err
@@ -52,7 +52,7 @@ func NewSearch(size int, epsilon, radius float32, opts ...StrategyOption) benchm
},
),
WithProp64(
- func(ctx context.Context, b *testing.B, c algorithm.Bit64, dataset assets.Dataset, ids []uint, cnt *uint64) (interface{}, error) {
+ func(ctx context.Context, b *testing.B, c algorithm.Bit64, dataset assets.Dataset, ids []uint, cnt *uint64) (any, error) {
v, err := dataset.Train(int(atomic.LoadUint64(cnt)) % dataset.TrainSize())
if err != nil {
return nil, err
diff --git a/hack/benchmark/core/benchmark/strategy/strategy.go b/hack/benchmark/core/benchmark/strategy/strategy.go
index 82c2e030c4..49b007b5f8 100644
--- a/hack/benchmark/core/benchmark/strategy/strategy.go
+++ b/hack/benchmark/core/benchmark/strategy/strategy.go
@@ -38,8 +38,8 @@ type strategy struct {
preProp32 func(context.Context, *testing.B, algorithm.Bit32, assets.Dataset) ([]uint, error)
preProp64 func(context.Context, *testing.B, algorithm.Bit64, assets.Dataset) ([]uint, error)
mode algorithm.Mode
- prop32 func(context.Context, *testing.B, algorithm.Bit32, assets.Dataset, []uint, *uint64) (interface{}, error)
- prop64 func(context.Context, *testing.B, algorithm.Bit64, assets.Dataset, []uint, *uint64) (interface{}, error)
+ prop32 func(context.Context, *testing.B, algorithm.Bit32, assets.Dataset, []uint, *uint64) (any, error)
+ prop64 func(context.Context, *testing.B, algorithm.Bit64, assets.Dataset, []uint, *uint64) (any, error)
parallel bool
}
@@ -78,7 +78,9 @@ func (s *strategy) Init(ctx context.Context, b *testing.B, dataset assets.Datase
return nil
}
-func (s *strategy) PreProp(ctx context.Context, b *testing.B, dataset assets.Dataset) ([]uint, error) {
+func (s *strategy) PreProp(
+ ctx context.Context, b *testing.B, dataset assets.Dataset,
+) ([]uint, error) {
b.Helper()
switch s.mode {
@@ -120,7 +122,9 @@ func (s *strategy) Close() {
s.closer.Close()
}
-func (s *strategy) float32(ctx context.Context, b *testing.B, dataset assets.Dataset, ids []uint, cnt *uint64) {
+func (s *strategy) float32(
+ ctx context.Context, b *testing.B, dataset assets.Dataset, ids []uint, cnt *uint64,
+) {
b.Helper()
b.StopTimer()
@@ -151,7 +155,9 @@ func (s *strategy) float32(ctx context.Context, b *testing.B, dataset assets.Dat
b.StopTimer()
}
-func (s *strategy) float64(ctx context.Context, b *testing.B, dataset assets.Dataset, ids []uint, cnt *uint64) {
+func (s *strategy) float64(
+ ctx context.Context, b *testing.B, dataset assets.Dataset, ids []uint, cnt *uint64,
+) {
b.Helper()
b.StopTimer()
diff --git a/hack/benchmark/core/benchmark/strategy/strategy_option.go b/hack/benchmark/core/benchmark/strategy/strategy_option.go
index af1a1f3735..32235037ce 100644
--- a/hack/benchmark/core/benchmark/strategy/strategy_option.go
+++ b/hack/benchmark/core/benchmark/strategy/strategy_option.go
@@ -48,7 +48,7 @@ func WithPreProp32(
}
func WithProp32(
- fn func(context.Context, *testing.B, algorithm.Bit32, assets.Dataset, []uint, *uint64) (interface{}, error),
+ fn func(context.Context, *testing.B, algorithm.Bit32, assets.Dataset, []uint, *uint64) (any, error),
) StrategyOption {
return func(s *strategy) error {
if fn != nil {
@@ -70,7 +70,7 @@ func WithPreProp64(
}
func WithProp64(
- fn func(context.Context, *testing.B, algorithm.Bit64, assets.Dataset, []uint, *uint64) (interface{}, error),
+ fn func(context.Context, *testing.B, algorithm.Bit64, assets.Dataset, []uint, *uint64) (any, error),
) StrategyOption {
return func(s *strategy) error {
if fn != nil {
diff --git a/hack/benchmark/core/benchmark/strategy/strategy_option_test.go b/hack/benchmark/core/benchmark/strategy/strategy_option_test.go
index 30105ee777..e1c4195e76 100644
--- a/hack/benchmark/core/benchmark/strategy/strategy_option_test.go
+++ b/hack/benchmark/core/benchmark/strategy/strategy_option_test.go
@@ -107,7 +107,7 @@ package strategy
//
// func TestWithProp32(t *testing.T) {
// type args struct {
-// fn func(context.Context, *testing.B, algorithm.Bit32, assets.Dataset, []uint, *uint64) (interface{}, error)
+// fn func(context.Context, *testing.B, algorithm.Bit32, assets.Dataset, []uint, *uint64) (any, error)
// }
// type want struct {
// want StrategyOption
@@ -279,7 +279,7 @@ package strategy
//
// func TestWithProp64(t *testing.T) {
// type args struct {
-// fn func(context.Context, *testing.B, algorithm.Bit64, assets.Dataset, []uint, *uint64) (interface{}, error)
+// fn func(context.Context, *testing.B, algorithm.Bit64, assets.Dataset, []uint, *uint64) (any, error)
// }
// type want struct {
// want StrategyOption
diff --git a/hack/benchmark/core/benchmark/strategy/strategy_test.go b/hack/benchmark/core/benchmark/strategy/strategy_test.go
index 6163981226..3ac36b05db 100644
--- a/hack/benchmark/core/benchmark/strategy/strategy_test.go
+++ b/hack/benchmark/core/benchmark/strategy/strategy_test.go
@@ -121,8 +121,8 @@ package strategy
// preProp32 func(context.Context, *testing.B, algorithm.Bit32, assets.Dataset) ([]uint, error)
// preProp64 func(context.Context, *testing.B, algorithm.Bit64, assets.Dataset) ([]uint, error)
// mode algorithm.Mode
-// prop32 func(context.Context, *testing.B, algorithm.Bit32, assets.Dataset, []uint, *uint64) (interface{}, error)
-// prop64 func(context.Context, *testing.B, algorithm.Bit64, assets.Dataset, []uint, *uint64) (interface{}, error)
+// prop32 func(context.Context, *testing.B, algorithm.Bit32, assets.Dataset, []uint, *uint64) (any, error)
+// prop64 func(context.Context, *testing.B, algorithm.Bit64, assets.Dataset, []uint, *uint64) (any, error)
// parallel bool
// }
// type want struct {
@@ -270,8 +270,8 @@ package strategy
// preProp32 func(context.Context, *testing.B, algorithm.Bit32, assets.Dataset) ([]uint, error)
// preProp64 func(context.Context, *testing.B, algorithm.Bit64, assets.Dataset) ([]uint, error)
// mode algorithm.Mode
-// prop32 func(context.Context, *testing.B, algorithm.Bit32, assets.Dataset, []uint, *uint64) (interface{}, error)
-// prop64 func(context.Context, *testing.B, algorithm.Bit64, assets.Dataset, []uint, *uint64) (interface{}, error)
+// prop32 func(context.Context, *testing.B, algorithm.Bit32, assets.Dataset, []uint, *uint64) (any, error)
+// prop64 func(context.Context, *testing.B, algorithm.Bit64, assets.Dataset, []uint, *uint64) (any, error)
// parallel bool
// }
// type want struct {
@@ -424,8 +424,8 @@ package strategy
// preProp32 func(context.Context, *testing.B, algorithm.Bit32, assets.Dataset) ([]uint, error)
// preProp64 func(context.Context, *testing.B, algorithm.Bit64, assets.Dataset) ([]uint, error)
// mode algorithm.Mode
-// prop32 func(context.Context, *testing.B, algorithm.Bit32, assets.Dataset, []uint, *uint64) (interface{}, error)
-// prop64 func(context.Context, *testing.B, algorithm.Bit64, assets.Dataset, []uint, *uint64) (interface{}, error)
+// prop32 func(context.Context, *testing.B, algorithm.Bit32, assets.Dataset, []uint, *uint64) (any, error)
+// prop64 func(context.Context, *testing.B, algorithm.Bit64, assets.Dataset, []uint, *uint64) (any, error)
// parallel bool
// }
// type want struct {
@@ -565,8 +565,8 @@ package strategy
// preProp32 func(context.Context, *testing.B, algorithm.Bit32, assets.Dataset) ([]uint, error)
// preProp64 func(context.Context, *testing.B, algorithm.Bit64, assets.Dataset) ([]uint, error)
// mode algorithm.Mode
-// prop32 func(context.Context, *testing.B, algorithm.Bit32, assets.Dataset, []uint, *uint64) (interface{}, error)
-// prop64 func(context.Context, *testing.B, algorithm.Bit64, assets.Dataset, []uint, *uint64) (interface{}, error)
+// prop32 func(context.Context, *testing.B, algorithm.Bit32, assets.Dataset, []uint, *uint64) (any, error)
+// prop64 func(context.Context, *testing.B, algorithm.Bit64, assets.Dataset, []uint, *uint64) (any, error)
// parallel bool
// }
// type want struct {
@@ -700,8 +700,8 @@ package strategy
// preProp32 func(context.Context, *testing.B, algorithm.Bit32, assets.Dataset) ([]uint, error)
// preProp64 func(context.Context, *testing.B, algorithm.Bit64, assets.Dataset) ([]uint, error)
// mode algorithm.Mode
-// prop32 func(context.Context, *testing.B, algorithm.Bit32, assets.Dataset, []uint, *uint64) (interface{}, error)
-// prop64 func(context.Context, *testing.B, algorithm.Bit64, assets.Dataset, []uint, *uint64) (interface{}, error)
+// prop32 func(context.Context, *testing.B, algorithm.Bit32, assets.Dataset, []uint, *uint64) (any, error)
+// prop64 func(context.Context, *testing.B, algorithm.Bit64, assets.Dataset, []uint, *uint64) (any, error)
// parallel bool
// }
// type want struct {
@@ -850,8 +850,8 @@ package strategy
// preProp32 func(context.Context, *testing.B, algorithm.Bit32, assets.Dataset) ([]uint, error)
// preProp64 func(context.Context, *testing.B, algorithm.Bit64, assets.Dataset) ([]uint, error)
// mode algorithm.Mode
-// prop32 func(context.Context, *testing.B, algorithm.Bit32, assets.Dataset, []uint, *uint64) (interface{}, error)
-// prop64 func(context.Context, *testing.B, algorithm.Bit64, assets.Dataset, []uint, *uint64) (interface{}, error)
+// prop32 func(context.Context, *testing.B, algorithm.Bit32, assets.Dataset, []uint, *uint64) (any, error)
+// prop64 func(context.Context, *testing.B, algorithm.Bit64, assets.Dataset, []uint, *uint64) (any, error)
// parallel bool
// }
// type want struct {
diff --git a/hack/benchmark/core/benchmark/strategy/util.go b/hack/benchmark/core/benchmark/strategy/util.go
index c8eeec982f..d3cbd71a12 100644
--- a/hack/benchmark/core/benchmark/strategy/util.go
+++ b/hack/benchmark/core/benchmark/strategy/util.go
@@ -42,7 +42,9 @@ func wrapErrors(errs []error) (wrapped error) {
return
}
-func insertAndCreateIndex32(ctx context.Context, c algorithm.Bit32, dataset assets.Dataset) (ids []uint, err error) {
+func insertAndCreateIndex32(
+ ctx context.Context, c algorithm.Bit32, dataset assets.Dataset,
+) (ids []uint, err error) {
ids = make([]uint, 0, dataset.TrainSize()*bulkInsertCnt)
n := 0
@@ -72,7 +74,9 @@ func insertAndCreateIndex32(ctx context.Context, c algorithm.Bit32, dataset asse
return
}
-func insertAndCreateIndex64(ctx context.Context, c algorithm.Bit64, dataset assets.Dataset) (ids []uint, err error) {
+func insertAndCreateIndex64(
+ ctx context.Context, c algorithm.Bit64, dataset assets.Dataset,
+) (ids []uint, err error) {
ids = make([]uint, 0, dataset.TrainSize()*bulkInsertCnt)
n := 0
diff --git a/hack/benchmark/core/ngt/ngt_bench_test.go b/hack/benchmark/core/ngt/ngt_bench_test.go
index 8f3712fa39..e431b89eba 100644
--- a/hack/benchmark/core/ngt/ngt_bench_test.go
+++ b/hack/benchmark/core/ngt/ngt_bench_test.go
@@ -50,7 +50,9 @@ func init() {
targets = strings.Split(strings.TrimSpace(dataset), ",")
}
-func initCore(ctx context.Context, b *testing.B, dataset assets.Dataset) (algorithm.Bit32, algorithm.Closer, error) {
+func initCore(
+ ctx context.Context, b *testing.B, dataset assets.Dataset,
+) (algorithm.Bit32, algorithm.Closer, error) {
ngt, err := ngt.New(
ngt.WithDimension(dataset.Dimension()),
ngt.WithObjectType(dataset.ObjectType()),
diff --git a/hack/benchmark/internal/core/algorithm/algorithm.go b/hack/benchmark/internal/core/algorithm/algorithm.go
index 1100c35e17..b8e5e4412e 100644
--- a/hack/benchmark/internal/core/algorithm/algorithm.go
+++ b/hack/benchmark/internal/core/algorithm/algorithm.go
@@ -31,7 +31,7 @@ type Closer interface {
}
type Bit32 interface {
- Search(ctx context.Context, vec []float32, size int, epsilon, radius float32) (interface{}, error)
+ Search(ctx context.Context, vec []float32, size int, epsilon, radius float32) (any, error)
Insert(vec []float32) (uint, error)
InsertCommit(vec []float32, poolSize uint32) (uint, error)
BulkInsert(vecs [][]float32) ([]uint, []error)
@@ -46,7 +46,7 @@ type Bit32 interface {
}
type Bit64 interface {
- Search(ctx context.Context, vec []float64, size int, epsilon, radius float32) (interface{}, error)
+ Search(ctx context.Context, vec []float64, size int, epsilon, radius float32) (any, error)
Insert(vec []float64) (uint, error)
InsertCommit(vec []float64, poolSize uint32) (uint, error)
BulkInsert(vecs [][]float64) ([]uint, []error)
diff --git a/hack/benchmark/internal/core/algorithm/ngt/ngt.go b/hack/benchmark/internal/core/algorithm/ngt/ngt.go
index a90d4a7778..f61af649f8 100644
--- a/hack/benchmark/internal/core/algorithm/ngt/ngt.go
+++ b/hack/benchmark/internal/core/algorithm/ngt/ngt.go
@@ -75,7 +75,9 @@ func New(opts ...Option) (c.Bit32, error) {
return c, nil
}
-func (c *core) Search(ctx context.Context, vec []float32, size int, epsilon, radius float32) (interface{}, error) {
+func (c *core) Search(
+ ctx context.Context, vec []float32, size int, epsilon, radius float32,
+) (any, error) {
return c.NGT.Search(ctx, vec, size, epsilon, radius)
}
diff --git a/hack/benchmark/internal/core/algorithm/ngt/ngt_test.go b/hack/benchmark/internal/core/algorithm/ngt/ngt_test.go
index b46356f052..0a5221aa47 100644
--- a/hack/benchmark/internal/core/algorithm/ngt/ngt_test.go
+++ b/hack/benchmark/internal/core/algorithm/ngt/ngt_test.go
@@ -125,7 +125,7 @@ package ngt
// NGT ngt.NGT
// }
// type want struct {
-// want interface{}
+// want any
// err error
// }
// type test struct {
@@ -133,11 +133,11 @@ package ngt
// args args
// fields fields
// want want
-// checkFunc func(want, interface{}, error) error
+// checkFunc func(want, any, error) error
// beforeFunc func(*testing.T, args)
// afterFunc func(*testing.T, args)
// }
-// defaultCheckFunc := func(w want, got interface{}, err error) error {
+// defaultCheckFunc := func(w want, got any, err error) error {
// if !errors.Is(err, w.err) {
// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err)
// }
diff --git a/hack/benchmark/internal/db/nosql/cassandra/cassandra_test.go b/hack/benchmark/internal/db/nosql/cassandra/cassandra_test.go
index 5255c610f3..9f3eb41bc9 100644
--- a/hack/benchmark/internal/db/nosql/cassandra/cassandra_test.go
+++ b/hack/benchmark/internal/db/nosql/cassandra/cassandra_test.go
@@ -155,7 +155,7 @@ func initTable(b *testing.B, metas []MetaVector) {
ib := cassandra.Insert(metaTable).Columns(metaColumnSlice...)
bt := cassandra.Batch()
- entities := make(map[string]interface{}, len(metas)*4)
+ entities := make(map[string]any, len(metas)*4)
for i, m := range metas {
prefix := "p" + strconv.Itoa(i)
bt = bt.AddWithPrefix(prefix, ib)
@@ -175,9 +175,9 @@ func BenchmarkGocqlxSelectBindMap(b *testing.B) {
metas := loadData()
initTable(b, metas)
- keys := make([]map[string]interface{}, 0, len(metas))
+ keys := make([]map[string]any, 0, len(metas))
for _, m := range metas {
- keys = append(keys, map[string]interface{}{
+ keys = append(keys, map[string]any{
uuidColumn: m.UUID,
})
}
diff --git a/hack/benchmark/internal/operation/util.go b/hack/benchmark/internal/operation/util.go
index f924e5a814..a35c14454f 100644
--- a/hack/benchmark/internal/operation/util.go
+++ b/hack/benchmark/internal/operation/util.go
@@ -38,7 +38,7 @@ func grpcError(tb testing.TB, err error) {
)
}
-func statusError(tb testing.TB, code int32, message string, details ...interface{}) {
+func statusError(tb testing.TB, code int32, message string, details ...any) {
tb.Helper()
tb.Errorf("code: %d\tmessage: %s\tdetails: %s",
code,
diff --git a/hack/benchmark/internal/operation/util_test.go b/hack/benchmark/internal/operation/util_test.go
index e948032010..33ea3d320e 100644
--- a/hack/benchmark/internal/operation/util_test.go
+++ b/hack/benchmark/internal/operation/util_test.go
@@ -104,7 +104,7 @@ package operation
// tb testing.TB
// code int32
// message string
-// details []interface{}
+// details []any
// }
// type want struct {
// }
diff --git a/hack/benchmark/src/singleflight/singleflight_bench_test.go b/hack/benchmark/src/singleflight/singleflight_bench_test.go
index 9a3f4029d3..a767e1672c 100644
--- a/hack/benchmark/src/singleflight/singleflight_bench_test.go
+++ b/hack/benchmark/src/singleflight/singleflight_bench_test.go
@@ -118,7 +118,7 @@ func Benchmark_group_Do_with_sync_singleflight(b *testing.B) {
initDoFn: func() func(ctx context.Context, key string, fn func(context.Context) (string, error)) {
g := new(stdsingleflight.Group)
return func(ctx context.Context, key string, fn func(context.Context) (string, error)) {
- g.Do(key, func() (interface{}, error) { return fn(context.Background()) })
+ g.Do(key, func() (any, error) { return fn(context.Background()) })
}
},
sleepDur: dur,
diff --git a/hack/docker/gen/main.go b/hack/docker/gen/main.go
new file mode 100644
index 0000000000..34c9425864
--- /dev/null
+++ b/hack/docker/gen/main.go
@@ -0,0 +1,746 @@
+//
+// Copyright (C) 2019-2024 vdaas.org vald team
+//
+// 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
+//
+// https://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 main
+
+import (
+ "bytes"
+ "context"
+ "io/fs"
+ "os"
+ "os/signal"
+ "regexp"
+ "slices"
+ "syscall"
+ "text/template"
+ "time"
+
+ "github.com/vdaas/vald/internal/errors"
+ "github.com/vdaas/vald/internal/file"
+ "github.com/vdaas/vald/internal/log"
+ "github.com/vdaas/vald/internal/safety"
+ "github.com/vdaas/vald/internal/strings"
+ "github.com/vdaas/vald/internal/sync/errgroup"
+)
+
+const tmpl = `# syntax = docker/dockerfile:latest
+#
+# Copyright (C) 2019-{{.Year}} {{.Maintainer}}
+#
+# 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
+#
+# https://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.
+#
+
+# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go
+
+ARG UPX_OPTIONS=-9
+
+{{- range $key, $value := .Arguments }}
+ARG {{$key}}={{$value}}
+{{- end}}
+{{- range $image := .ExtraImages }}
+# skipcq: DOK-DL3026
+FROM {{$image}}
+{{- end}}
+# skipcq: DOK-DL3026
+FROM {{.BuilderImage}}:{{.BuilderTag}}{{- if not .DevContainer}} AS builder {{- end}}
+ARG MAINTAINER="{{.Maintainer}}"
+LABEL maintainer="${MAINTAINER}"
+
+ARG TARGETARCH
+ARG TARGETOS
+ARG GO_VERSION
+ARG RUST_VERSION
+
+{{- range $keyValue := .EnvironmentsSlice }}
+ENV {{$keyValue}}
+{{- end}}
+
+SHELL ["/bin/bash", "-o", "pipefail", "-c"]
+# skipcq: DOK-DL3008
+RUN apt-get clean \
+ && rm -rf \
+ /var/lib/apt/lists/* \
+ /var/cache/* \
+ && apt-get update -y \
+ && apt-get upgrade -y \
+ && apt-get install -y --no-install-recommends --fix-missing \
+ build-essential \
+ ca-certificates \
+ curl \
+ git \
+{{- range $epkg := .ExtraPackages }}
+ {{$epkg}} \
+{{- end}}
+ && ldconfig \
+ && apt-get clean \
+ && rm -rf \
+ /var/lib/apt/lists/* \
+ /var/cache/* \
+ && apt-get autoremove
+
+WORKDIR {{.RootDir}}/${ORG}/${REPO}
+COPY Makefile .
+COPY .git .
+{{- if not .DevContainer}}
+{{- if eq .ContainerType 0 }}
+COPY go.mod .
+COPY go.sum .
+{{- else if eq .ContainerType 3 }}
+COPY go.mod .
+COPY go.sum .
+{{- end}}
+{{- if .ConfigExists }}
+COPY cmd/${PKG}/sample.yaml {{$.TmpConfigPath}}
+{{- end}}
+
+{{- range $files := .CopyDirectories }}
+WORKDIR {{$.RootDir}}/${ORG}/${REPO}/{{$files}}
+COPY {{$files}} .
+{{- end}}
+{{- range $files := .ExtraCopies }}
+COPY {{$files}}
+{{- end}}
+
+{{- else}}
+WORKDIR {{.RootDir}}/${ORG}/${REPO}
+COPY . .
+{{- end}}
+
+WORKDIR {{.RootDir}}/${ORG}/${REPO}
+{{- if .RunCommands}}
+#skipcq: DOK-W1001, DOK-SC2086
+RUN {{RunCommands .RunCommands}}
+{{- end}}
+
+{{- if not .DevContainer}}
+# skipcq: DOK-DL3026
+FROM {{.RuntimeImage}}:{{.RuntimeTag}}
+ARG MAINTAINER="{{.Maintainer}}"
+LABEL maintainer="${MAINTAINER}"
+
+ENV APP_NAME={{.AppName}}
+
+COPY --from=builder {{.BinDir}}/${APP_NAME} {{.BinDir}}/${APP_NAME}
+{{- if .ConfigExists }}
+COPY --from=builder {{$.TmpConfigPath}} /etc/server/config.yaml
+{{- end}}
+{{- range $from, $file := .StageFiles }}
+COPY --from=builder {{$file}} {{$file}}
+{{- end}}
+USER nonroot:nonroot
+
+{{- if .Entrypoints}}
+ENTRYPOINT [{{Entrypoint .Entrypoints}}]
+{{- else}}
+ENTRYPOINT ["{{.BinDir}}/{{.AppName}}"]
+{{- end}}
+{{- end}}`
+
+var docker = template.Must(template.New("Dockerfile").Funcs(template.FuncMap{
+ "RunCommands": func(commands []string) string {
+ if len(commands) == 0 {
+ return ""
+ }
+ var b strings.Builder
+ for i, cmd := range commands {
+ if i > 0 {
+ b.WriteString(" \\\n && ")
+ }
+ b.WriteString(cmd)
+ }
+ return b.String()
+ },
+ "Entrypoint": func(entries []string) string {
+ if len(entries) == 0 {
+ return "\"{{.BinDir}}/{{.AppName}}\""
+ }
+ return "\"" + strings.Join(entries, "\", \"") + "\""
+ },
+}).Parse(tmpl))
+
+type Data struct {
+ ConfigExists bool
+ DevContainer bool
+ Year int
+ ContainerType ContainerType
+ AppName string
+ BinDir string
+ BuilderImage string
+ BuilderTag string
+ Maintainer string
+ PackageDir string
+ RootDir string
+ RuntimeImage string
+ RuntimeTag string
+ TmpConfigPath string
+ Arguments map[string]string
+ Environments map[string]string
+ Entrypoints []string
+ EnvironmentsSlice []string
+ CopyDirectories []string
+ ExtraCopies []string
+ ExtraImages []string
+ ExtraPackages []string
+ Preprocess []string
+ RunCommands []string
+ StageFiles []string
+}
+
+type ContainerType int
+
+const (
+ organization = "vdaas"
+ repository = "vald"
+ minimumArgumentLength = 2
+ defaultMaintainer = organization + ".org " + repository + " team <" + repository + "@" + organization + ".org>"
+ maintainerKey = "MAINTAINER"
+ defaultRuntimeImage = "gcr.io/distroless/static"
+ defaultRuntimeTag = "nonroot"
+ defaultBuilderImage = "ghcr.io/vdaas/vald/vald-buildbase"
+ defaultBuilderTag = "nightly"
+ defaultBinaryDir = "/usr/bin"
+ defaultTmpConfigPath = "/tmp/config.yaml"
+
+ goWorkdir = "${GOPATH}/src/github.com"
+ rustWorkdir = "${HOME}/rust/src/github.com"
+
+ agentInernalPackage = "pkg/agent/internal"
+
+ ngtPreprocess = "make ngt/install"
+ faissPreprocess = "make faiss/install"
+
+ helmOperatorRootdir = "/opt/helm"
+ helmOperatorWatchFile = helmOperatorRootdir + "/watches.yaml"
+ helmOperatorChartsDir = helmOperatorRootdir + "/charts"
+)
+
+const (
+ Go ContainerType = iota
+ Rust
+ DevContainer
+ HelmOperator
+ Other
+)
+
+var (
+ defaultEnvironments = map[string]string{
+ "DEBIAN_FRONTEND": "noninteractive",
+ "HOME": "/root",
+ "INITRD": "No",
+ "LANG": "en_US.UTF-8",
+ "ORG": organization,
+ "PATH": "${PATH}:/usr/local/bin",
+ "REPO": repository,
+ }
+ goDefaultEnvironments = map[string]string{
+ "GOROOT": "/opt/go",
+ "GOPATH": "/go",
+ "GO111MODULE": "on",
+ "PATH": "${PATH}:${GOROOT}/bin:${GOPATH}/bin:/usr/local/bin",
+ }
+ rustDefaultEnvironments = map[string]string{
+ "RUST_HOME": "/usr/loacl/lib/rust",
+ "RUSTUP_HOME": "${RUST_HOME}/rustup",
+ "CARGO_HOME": "${RUST_HOME}/cargo",
+ "PATH": "${PATH}:${RUSTUP_HOME}/bin:${CARGO_HOME}/bin:/usr/local/bin",
+ }
+
+ defaultCopyDirectories = []string{
+ "Makefile.d",
+ "versions",
+ }
+ goDefaultCopyDirectories = []string{
+ "internal",
+ "apis/grpc",
+ "pkg/${PKG}",
+ "cmd/${PKG}",
+ }
+ rustDefaultCopyDirectories = []string{
+ "rust",
+ }
+
+ goInstallCommands = []string{
+ `--mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \
+ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \
+ make GO_VERSION="${GO_VERSION}" go/install`,
+ "make go/download",
+ }
+ rustInstallCommands = []string{
+ "make RUST_VERSION=\"${RUST_VERSION}\" rust/install",
+ }
+ goBuildCommands = []string{
+ "make GOARCH=\"${TARGETARCH}\" GOOS=\"${TARGETOS}\" REPO=\"${ORG}\" NAME=\"${REPO}\" cmd/${PKG}/${APP_NAME}",
+ "mv \"cmd/${PKG}/${APP_NAME}\" \"{{$.BinDir}}/${APP_NAME}\"",
+ }
+ rustBuildCommands = []string{
+ "make rust/target/release/${APP_NAME}",
+ "mv \"rust/target/release/${APP_NAME}\" \"{{$.BinDir}}/${APP_NAME}\"",
+ "rm -rf rust/target",
+ }
+
+ clangBuildDeps = []string{
+ "cmake",
+ "g++",
+ "gcc",
+ "unzip",
+ }
+ ngtBuildDeps = []string{
+ "liblapack-dev",
+ "libomp-dev",
+ "libopenblas-dev",
+ }
+ faissBuildDeps = []string{
+ "gfortran",
+ }
+ devContainerDeps = []string{
+ "curl",
+ "gawk",
+ "git",
+ "gnupg2",
+ "graphviz",
+ "jq",
+ "libhdf5-dev",
+ "libaec-dev",
+ "nodejs",
+ "npm",
+ "sed",
+ "zip",
+ }
+
+ ciContainerPreprocess = []string{
+ "make GOARCH=${TARGETARCH} GOOS=${TARGETOS} deps GO_CLEAN_DEPS=false",
+ "make GOARCH=${TARGETARCH} GOOS=${TARGETOS} golangci-lint/install",
+ "make GOARCH=${TARGETARCH} GOOS=${TARGETOS} gotestfmt/install",
+ "make buf/install",
+ "make hdf5/install",
+ "make helm-docs/install",
+ "make helm/install",
+ "make k3d/install",
+ "make k9s/install",
+ "make kind/install",
+ "make kubectl/install",
+ "make kubelinter/install",
+ "make reviewdog/install",
+ "make tparse/install",
+ "make valdcli/install",
+ "make yq/install",
+ "make minikube/install",
+ "make stern/install",
+ "make telepresence/install",
+ }
+
+ devContainerPreprocess = []string{
+ "echo \"installing golang vscode extension dependencies\"",
+ "make delve/install",
+ "make gomodifytags/install",
+ "make gopls/install",
+ "make gotests/install",
+ "make impl/install",
+ "make staticcheck/install",
+ }
+)
+
+func appendM[K comparable](maps ...map[K]string) map[K]string {
+ if len(maps) == 0 {
+ return nil
+ }
+ result := maps[0]
+ for _, m := range maps[1:] {
+ for k, v := range m {
+ ev, ok := result[k]
+ if ok {
+ v += ":" + ev
+ }
+ result[k] = v
+ }
+ }
+
+ for k, v := range result {
+ vs := strings.Split(v, ":")
+ slices.Sort(vs)
+ v = strings.Join(slices.Compact(vs), ":")
+ if strings.Contains(v, "${PATH}:") {
+ v = strings.TrimPrefix(strings.ReplaceAll(strings.ReplaceAll(v, "${PATH}", ""), "::", ":")+":${PATH}", ":")
+ }
+ result[k] = v
+ }
+ return result
+}
+
+var re = regexp.MustCompile(`\$\{?(\w+)\}?`)
+
+func extractVariables(value string) []string {
+ matches := re.FindAllStringSubmatch(value, -1)
+ vars := make([]string, 0, len(matches))
+ for _, match := range matches {
+ vars = append(vars, match[1])
+ }
+ return vars
+}
+
+func topologicalSort(envMap map[string]string) []string {
+ // Graph structures
+ inDegree := make(map[string]int)
+ graph := make(map[string][]string)
+
+ // Initialize the graph
+ for key, value := range envMap {
+ vars := extractVariables(value)
+ for _, refKey := range vars {
+ if refKey != key {
+ graph[refKey] = append(graph[refKey], key)
+ inDegree[key]++
+ }
+ }
+ }
+
+ queue := make([]string, 0, len(envMap)-len(graph))
+ for key := range envMap {
+ if inDegree[key] == 0 {
+ queue = append(queue, key)
+ }
+ }
+
+ slices.Sort(queue)
+
+ // Topological sort
+ result := make([]string, 0, len(envMap))
+ for len(queue) > 0 {
+ node := queue[0]
+ queue = queue[1:]
+ if value, exists := envMap[node]; exists {
+ result = append(result, node+"="+value)
+ }
+ for _, neighbor := range graph[node] {
+ inDegree[neighbor]--
+ if inDegree[neighbor] == 0 {
+ queue = append(queue, neighbor)
+ }
+ }
+ }
+
+ return result
+}
+
+func main() {
+ log.Init()
+ if len(os.Args) < minimumArgumentLength {
+ // skipcq: RVV-A0003
+ log.Fatal(errors.New("invalid argument"))
+ }
+
+ ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGINT,
+ syscall.SIGQUIT,
+ syscall.SIGHUP,
+ syscall.SIGALRM,
+ syscall.SIGKILL,
+ syscall.SIGTERM)
+ defer cancel()
+
+ maintainer := os.Getenv(maintainerKey)
+ if len(maintainer) == 0 {
+ maintainer = defaultMaintainer
+ }
+ year := time.Now().Year()
+ eg, egctx := errgroup.New(ctx)
+ for n, d := range map[string]Data{
+ "vald-agent-ngt": {
+ AppName: "ngt",
+ PackageDir: "agent/core/ngt",
+ CopyDirectories: []string{agentInernalPackage},
+ ExtraPackages: append(clangBuildDeps, ngtBuildDeps...),
+ Preprocess: []string{ngtPreprocess},
+ },
+ "vald-agent-faiss": {
+ AppName: "faiss",
+ PackageDir: "agent/core/faiss",
+ CopyDirectories: []string{agentInernalPackage},
+ ExtraPackages: append(clangBuildDeps,
+ append(ngtBuildDeps,
+ faissBuildDeps...)...),
+ Preprocess: []string{faissPreprocess},
+ },
+ "vald-agent": {
+ AppName: "agent",
+ PackageDir: "agent/core/agent",
+ ContainerType: Rust,
+ RuntimeImage: "gcr.io/distroless/cc-debian12",
+ ExtraPackages: append(clangBuildDeps,
+ append(ngtBuildDeps,
+ faissBuildDeps...)...),
+ Preprocess: []string{
+ ngtPreprocess,
+ faissPreprocess,
+ },
+ },
+ "vald-agent-sidecar": {
+ AppName: "sidecar",
+ PackageDir: "agent/sidecar",
+ CopyDirectories: []string{agentInernalPackage},
+ },
+ "vald-discoverer-k8s": {
+ AppName: "discoverer",
+ PackageDir: "discoverer/k8s",
+ },
+ "vald-gateway-lb": {
+ AppName: "lb",
+ PackageDir: "gateway/lb",
+ },
+ "vald-gateway-filter": {
+ AppName: "filter",
+ PackageDir: "gateway/filter",
+ },
+ "vald-gateway-mirror": {
+ AppName: "mirror",
+ PackageDir: "gateway/mirror",
+ },
+ "vald-manager-index": {
+ AppName: "index",
+ PackageDir: "manager/index",
+ },
+ "vald-index-correction": {
+ AppName: "index-correction",
+ PackageDir: "index/job/correction",
+ },
+ "vald-index-creation": {
+ AppName: "index-creation",
+ PackageDir: "index/job/creation",
+ },
+ "vald-index-save": {
+ AppName: "index-save",
+ PackageDir: "index/job/save",
+ },
+ "vald-readreplica-rotate": {
+ AppName: "readreplica-rotate",
+ PackageDir: "index/job/readreplica/rotate",
+ },
+ "vald-index-operator": {
+ AppName: "index-operator",
+ PackageDir: "index/operator",
+ },
+ "vald-benchmark-job": {
+ AppName: "job",
+ PackageDir: "tools/benchmark/job",
+ ExtraPackages: append(clangBuildDeps, "libhdf5-dev", "libaec-dev"),
+ Preprocess: []string{
+ "make hdf5/install",
+ },
+ },
+ "vald-benchmark-operator": {
+ AppName: "operator",
+ PackageDir: "tools/benchmark/operator",
+ },
+ "vald-helm-operator": {
+ AppName: "helm-operator",
+ PackageDir: "operator/helm",
+ ContainerType: HelmOperator,
+ Arguments: map[string]string{
+ "OPERATOR_SDK_VERSION": "latest",
+ },
+ CopyDirectories: []string{
+ "internal",
+ "charts",
+ "hack",
+ },
+ ExtraCopies: []string{
+ "--from=operator /usr/local/bin/${APP_NAME} {{$.BinDir}}/${APP_NAME}",
+ },
+ ExtraImages: []string{
+ "quay.io/operator-framework/helm-operator:${OPERATOR_SDK_VERSION} AS operator",
+ },
+ ExtraPackages: []string{"upx"},
+ Preprocess: []string{
+ "mkdir -p " + helmOperatorChartsDir,
+ `{ \
+ echo "---"; \
+ echo "- version: v1"; \
+ echo " group: vald.vdaas.org"; \
+ echo " kind: ValdRelease"; \
+ echo " chart: ` + helmOperatorChartsDir + `/vald"; \
+ echo "- version: v1"; \
+ echo " group: vald.vdaas.org"; \
+ echo " kind: ValdHelmOperatorRelease"; \
+ echo " chart: ` + helmOperatorChartsDir + `/vald-helm-operator"; \
+ } > ` + helmOperatorWatchFile,
+ "make GOARCH=${TARGETARCH} GOOS=${TARGETOS} helm/schema/vald",
+ "make GOARCH=${TARGETARCH} GOOS=${TARGETOS} helm/schema/vald-helm-operator",
+ "cp -r charts/* " + helmOperatorChartsDir + "/",
+ "upx \"{{$.BinDir}}/${APP_NAME}\"",
+ },
+ StageFiles: []string{
+ helmOperatorWatchFile,
+ helmOperatorChartsDir + "/vald",
+ helmOperatorChartsDir + "/vald-helm-operator",
+ },
+ Entrypoints: []string{"{{$.BinDir}}/{{.AppName}}", "run", "--watches-file=" + helmOperatorWatchFile},
+ },
+ "vald-cli-loadtest": {
+ AppName: "loadtest",
+ PackageDir: "tools/cli/loadtest",
+ ExtraPackages: append(clangBuildDeps, "libhdf5-dev", "libaec-dev"),
+ CopyDirectories: []string{
+ "hack/benchmark/assets/x1b",
+ },
+ Preprocess: []string{
+ "make hdf5/install",
+ },
+ },
+ "vald-ci-container": {
+ AppName: "ci-container",
+ DevContainer: true,
+ ContainerType: DevContainer,
+ PackageDir: "ci/base",
+ ExtraPackages: append(clangBuildDeps,
+ append(ngtBuildDeps,
+ append(faissBuildDeps,
+ devContainerDeps...)...)...),
+ Preprocess: append([]string{
+ "sysctl -w net.ipv6.conf.all.disable_ipv6=1",
+ "sysctl -w net.ipv6.conf.default.disable_ipv6=1",
+ "sysctl -w net.ipv6.conf.lo.disable_ipv6=1",
+ "sysctl -p",
+ }, append(ciContainerPreprocess, ngtPreprocess, faissPreprocess)...),
+ },
+ "vald-dev-container": {
+ AppName: "dev-container",
+ BuilderImage: "mcr.microsoft.com/vscode/devcontainers/base",
+ BuilderTag: "debian",
+ DevContainer: true,
+ ContainerType: DevContainer,
+ PackageDir: "dev",
+ ExtraPackages: append(clangBuildDeps,
+ append(ngtBuildDeps,
+ append(faissBuildDeps,
+ devContainerDeps...)...)...),
+ Preprocess: append(ciContainerPreprocess,
+ append(devContainerPreprocess,
+ ngtPreprocess,
+ faissPreprocess)...),
+ },
+ } {
+ name := n
+ data := d
+
+ eg.Go(safety.RecoverFunc(func() error {
+ data.Maintainer = maintainer
+ data.Year = year
+ if data.BinDir == "" {
+ data.BinDir = defaultBinaryDir
+ }
+ if data.TmpConfigPath == "" {
+ data.TmpConfigPath = defaultTmpConfigPath
+ }
+ if data.RuntimeImage == "" {
+ data.RuntimeImage = defaultRuntimeImage
+ }
+ if data.RuntimeTag == "" {
+ data.RuntimeTag = defaultRuntimeTag
+ }
+ if data.BuilderImage == "" {
+ data.BuilderImage = defaultBuilderImage
+ }
+ if data.BuilderTag == "" {
+ data.BuilderTag = defaultBuilderTag
+ }
+
+ if data.CopyDirectories != nil {
+ data.CopyDirectories = append(defaultCopyDirectories, data.CopyDirectories...)
+ } else {
+ data.CopyDirectories = make([]string, len(defaultCopyDirectories))
+ copy(data.CopyDirectories, defaultCopyDirectories)
+ }
+ if data.Environments != nil {
+ data.Environments = appendM(data.Environments, defaultEnvironments)
+ } else {
+ data.Environments = make(map[string]string, len(defaultEnvironments))
+ data.Environments = appendM(data.Environments, defaultEnvironments)
+ }
+ switch data.ContainerType {
+ case Go:
+ data.CopyDirectories = append(data.CopyDirectories, goDefaultCopyDirectories...)
+ data.Environments = appendM(data.Environments, goDefaultEnvironments)
+ data.RootDir = goWorkdir
+ commands := make([]string, 0, len(goInstallCommands)+len(data.Preprocess)+len(goBuildCommands))
+ commands = append(commands, goInstallCommands...)
+ if data.Preprocess != nil {
+ commands = append(commands, data.Preprocess...)
+ }
+ if file.Exists(file.Join(os.Args[1], "cmd", data.PackageDir)) {
+ commands = append(commands, goBuildCommands...)
+ }
+ data.RunCommands = commands
+ case Rust:
+ data.CopyDirectories = append(data.CopyDirectories, rustDefaultCopyDirectories...)
+ data.Environments = appendM(data.Environments, rustDefaultEnvironments)
+ data.RootDir = rustWorkdir
+ commands := make([]string, 0, len(rustInstallCommands)+len(data.Preprocess)+len(rustBuildCommands))
+ commands = append(commands, rustInstallCommands...)
+ if data.Preprocess != nil {
+ commands = append(commands, data.Preprocess...)
+ }
+ data.RunCommands = append(commands, rustBuildCommands...)
+ case DevContainer:
+ data.CopyDirectories = append(data.CopyDirectories, append(goDefaultCopyDirectories, rustDefaultCopyDirectories...)...)
+ data.Environments = appendM(data.Environments, goDefaultEnvironments, rustDefaultEnvironments)
+ data.RootDir = goWorkdir
+ commands := make([]string, 0, len(goInstallCommands)+len(rustInstallCommands)+len(data.Preprocess))
+ commands = append(commands, append(goInstallCommands, rustInstallCommands...)...)
+ if data.Preprocess != nil {
+ commands = append(commands, data.Preprocess...)
+ }
+ commands = append(commands, "rm -rf {{.RootDir}}/${ORG}/${REPO}/*")
+ data.RunCommands = commands
+ case HelmOperator:
+ data.Environments = appendM(data.Environments, goDefaultEnvironments)
+ data.RootDir = goWorkdir
+ commands := make([]string, 0, len(goInstallCommands)+len(data.Preprocess))
+ commands = append(commands, goInstallCommands...)
+ if data.Preprocess != nil {
+ commands = append(commands, data.Preprocess...)
+ }
+ data.RunCommands = commands
+ default:
+ data.RootDir = "${HOME}"
+ data.Environments["ROOTDIR"] = os.Args[1]
+ }
+
+ data.Environments["APP_NAME"] = data.AppName
+ data.Environments["PKG"] = data.PackageDir
+ data.EnvironmentsSlice = topologicalSort(data.Environments)
+ data.ConfigExists = file.Exists(file.Join(os.Args[1], "cmd", data.PackageDir, "sample.yaml"))
+
+ buf := bytes.NewBuffer(make([]byte, 0, len(tmpl)))
+ log.Infof("generating %s's docker file", name)
+ docker.Execute(buf, data)
+ tpl := buf.String()
+ buf.Reset()
+ template.Must(template.New("Dockerfile").Parse(tpl)).Execute(buf, data)
+ file.OverWriteFile(egctx, file.Join(os.Args[1], "dockers", data.PackageDir, "Dockerfile"), buf, fs.ModePerm)
+ return nil
+ }))
+ }
+ eg.Wait()
+}
diff --git a/hack/git/hooks/pre-commit b/hack/git/hooks/pre-commit
index fce9fcff2a..0405069719 100644
--- a/hack/git/hooks/pre-commit
+++ b/hack/git/hooks/pre-commit
@@ -20,25 +20,9 @@ if git diff HEAD^ --name-only | grep ".go$" > /dev/null; then
cp go.mod ${TMPDIR}
cp go.sum ${TMPDIR}
- # golines
- echo "Run golines..."
- find ./ -type d -name .git -prune -o -type f -regex '.*[^\.pb]\.go' -print | xargs golines -w -m 200
- echo "golines finished."
-
- # gofumpt
- echo "Run gofumpt..."
- find ./ -type d -name .git -prune -o -type f -regex '.*[^\.pb]\.go' -print | xargs gofumpt -w
- echo "gofumpt finished."
-
- # goimports
- echo "Run strictgoimports..."
- find ./ -type d -name .git -prune -o -type f -regex '.*\.go' -print | xargs strictgoimports -w
- echo "strictgoimports finished."
-
- # goimports
- echo "Run goimports..."
- find ./ -type d -name .git -prune -o -type f -regex '.*\.go' -print | xargs goimports -w
- echo "goimports finished."
+ # format go code
+ make format/go
+ make format/go/test
# go build
echo "Run go build..."
@@ -48,7 +32,7 @@ if git diff HEAD^ --name-only | grep ".go$" > /dev/null; then
if [ `git rev-parse --abbrev-ref HEAD` = "main" ]; then
# golangci-lint
echo "Run golangci-lint..."
- golangci-lint run --fast --disable=gochecknoglobals --fix --color always -j 16 --skip-dirs apis/grpc --exclude-use-default=false ./...
+ make go/lint
echo "golangci-lint finished."
fi
mv -f ${TMPDIR}/go.mod .
diff --git a/hack/go.mod.default b/hack/go.mod.default
index a6b76d935c..c33a973129 100644
--- a/hack/go.mod.default
+++ b/hack/go.mod.default
@@ -1,6 +1,6 @@
module github.com/vdaas/vald
-go 1.22.3
+go 1.22.5
replace (
cloud.google.com/go => cloud.google.com/go upgrade
@@ -162,6 +162,7 @@ replace (
github.com/googleapis/gax-go/v2 => github.com/googleapis/gax-go/v2 upgrade
github.com/gorilla/mux => github.com/gorilla/mux upgrade
github.com/gorilla/websocket => github.com/gorilla/websocket upgrade
+ github.com/grafana/pyroscope-go/godeltaprof => github.com/grafana/pyroscope-go/godeltaprof upgrade
github.com/gregjones/httpcache => github.com/gregjones/httpcache upgrade
github.com/grpc-ecosystem/grpc-gateway/v2 => github.com/grpc-ecosystem/grpc-gateway/v2 upgrade
github.com/hailocab/go-hostpool => github.com/kpango/go-hostpool upgrade
@@ -328,19 +329,19 @@ replace (
gopkg.in/yaml.v2 => gopkg.in/yaml.v2 upgrade
gopkg.in/yaml.v3 => gopkg.in/yaml.v3 upgrade
honnef.co/go/tools => honnef.co/go/tools upgrade
- k8s.io/api => k8s.io/api v0.30.0
- k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.30.0
- k8s.io/apimachinery => k8s.io/apimachinery v0.30.0
- k8s.io/cli-runtime => k8s.io/cli-runtime v0.30.0
- k8s.io/client-go => k8s.io/client-go v0.30.0
- k8s.io/component-base => k8s.io/component-base v0.30.0
+ k8s.io/api => k8s.io/api v0.30.2
+ k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.30.2
+ k8s.io/apimachinery => k8s.io/apimachinery v0.30.2
+ k8s.io/cli-runtime => k8s.io/cli-runtime v0.30.2
+ k8s.io/client-go => k8s.io/client-go v0.30.2
+ k8s.io/component-base => k8s.io/component-base v0.30.2
k8s.io/klog/v2 => k8s.io/klog/v2 upgrade
k8s.io/kube-openapi => k8s.io/kube-openapi master
- k8s.io/kubernetes => k8s.io/kubernetes v0.30.0
- k8s.io/metrics => k8s.io/metrics v0.30.0
+ k8s.io/kubernetes => k8s.io/kubernetes v0.30.2
+ k8s.io/metrics => k8s.io/metrics v0.30.2
nhooyr.io/websocket => nhooyr.io/websocket upgrade
rsc.io/pdf => rsc.io/pdf upgrade
- sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.18.2
+ sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.18.4
sigs.k8s.io/json => sigs.k8s.io/json upgrade
sigs.k8s.io/kustomize => sigs.k8s.io/kustomize upgrade
sigs.k8s.io/structured-merge-diff/v4 => sigs.k8s.io/structured-merge-diff/v4 upgrade
diff --git a/hack/gorules/rules.go b/hack/gorules/rules.go
index d077ad669b..d130fe4a06 100644
--- a/hack/gorules/rules.go
+++ b/hack/gorules/rules.go
@@ -13,9 +13,7 @@
// limitations under the License.
package gorules
-import (
- "github.com/quasilyte/go-ruleguard/dsl"
-)
+import "github.com/quasilyte/go-ruleguard/dsl"
func CheckPayloadObjectAccess(m dsl.Matcher) {
m.Import("github.com/vdaas/vald/apis/grpc/v1/payload")
diff --git a/hack/license/gen/main.go b/hack/license/gen/main.go
index 68f28a86d0..a13db09c43 100644
--- a/hack/license/gen/main.go
+++ b/hack/license/gen/main.go
@@ -287,6 +287,10 @@ func readAndRewrite(path string) error {
"semaphore_example_test.go",
"semaphore_test.go":
tmpl = goStandard
+ case "error_details.pb.go",
+ "error_details.pb.json.go",
+ "error_details_vtproto.pb.go":
+ tmpl = googleProtoApache
default:
}
case ".proto":
diff --git a/internal/backoff/backoff.go b/internal/backoff/backoff.go
index 8e8b219a9f..04c1355739 100644
--- a/internal/backoff/backoff.go
+++ b/internal/backoff/backoff.go
@@ -55,7 +55,7 @@ type backoff struct {
// Backoff represents an interface to handle backoff operation.
type Backoff interface {
- Do(context.Context, func(ctx context.Context) (interface{}, bool, error)) (interface{}, error)
+ Do(context.Context, func(ctx context.Context) (any, bool, error)) (any, error)
Close()
}
@@ -77,7 +77,9 @@ func New(opts ...Option) Backoff {
}
// Do tries to backoff using the input function and returns the response and error.
-func (b *backoff) Do(ctx context.Context, f func(ctx context.Context) (val interface{}, retryable bool, err error)) (res interface{}, err error) {
+func (b *backoff) Do(
+ ctx context.Context, f func(ctx context.Context) (val any, retryable bool, err error),
+) (res any, err error) {
if f == nil {
return
}
@@ -133,7 +135,7 @@ func (b *backoff) Do(ctx context.Context, f func(ctx context.Context) (val inter
return nil, errors.Join(err, dctx.Err())
}
default:
- res, ret, err = func() (val interface{}, retryable bool, err error) {
+ res, ret, err = func() (val any, retryable bool, err error) {
ssctx, span := trace.StartSpan(dctx, traceTag+"/"+strconv.Itoa(cnt+1))
defer func() {
if span != nil {
diff --git a/internal/backoff/backoff_test.go b/internal/backoff/backoff_test.go
index b907b19725..4cf3bc2df3 100644
--- a/internal/backoff/backoff_test.go
+++ b/internal/backoff/backoff_test.go
@@ -219,7 +219,7 @@ func Test_backoff_Do(t *testing.T) {
t.Parallel()
type args struct {
ctx context.Context
- f func(ctx context.Context) (val interface{}, retryable bool, err error)
+ f func(ctx context.Context) (val any, retryable bool, err error)
}
type fields struct {
backoffFactor float64
@@ -233,7 +233,7 @@ func Test_backoff_Do(t *testing.T) {
errLog bool
}
type want struct {
- wantRes interface{}
+ wantRes any
err error
}
type test struct {
@@ -241,11 +241,11 @@ func Test_backoff_Do(t *testing.T) {
args args
fields fields
want want
- checkFunc func(want, interface{}, error) error
+ checkFunc func(want, any, error) error
beforeFunc func(args)
afterFunc func(args)
}
- defaultCheckFunc := func(w want, gotRes interface{}, err error) error {
+ defaultCheckFunc := func(w want, gotRes any, err error) error {
if !errors.Is(err, w.err) {
return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err)
}
@@ -258,7 +258,7 @@ func Test_backoff_Do(t *testing.T) {
func() test {
ctx := context.Background()
err := errors.New("error is occurred")
- f := func(context.Context) (interface{}, bool, error) {
+ f := func(context.Context) (any, bool, error) {
return nil, false, err
}
return test{
@@ -274,7 +274,7 @@ func Test_backoff_Do(t *testing.T) {
}(),
func() test {
ctx := context.Background()
- f := func(context.Context) (interface{}, bool, error) {
+ f := func(context.Context) (any, bool, error) {
return nil, true, nil
}
return test{
@@ -289,7 +289,7 @@ func Test_backoff_Do(t *testing.T) {
func() test {
ctx := context.Background()
err := errors.New("erros is occurred")
- f := func(context.Context) (interface{}, bool, error) {
+ f := func(context.Context) (any, bool, error) {
return nil, false, err
}
return test{
@@ -318,7 +318,7 @@ func Test_backoff_Do(t *testing.T) {
func() test {
ctx := context.Background()
err := errors.New("erros is occurred")
- f := func(context.Context) (interface{}, bool, error) {
+ f := func(context.Context) (any, bool, error) {
return str, true, err
}
return test{
@@ -348,7 +348,7 @@ func Test_backoff_Do(t *testing.T) {
ctx := context.Background()
err := errors.New("erros is occurred")
cnt := 0
- f := func(context.Context) (interface{}, bool, error) {
+ f := func(context.Context) (any, bool, error) {
cnt++
if cnt == 2 {
return str, false, err
@@ -382,7 +382,7 @@ func Test_backoff_Do(t *testing.T) {
ctx := context.Background()
err := errors.New("erros is occurred")
cnt := 0
- f := func(context.Context) (interface{}, bool, error) {
+ f := func(context.Context) (any, bool, error) {
cnt++
if cnt == 2 {
return str, true, nil
@@ -414,7 +414,7 @@ func Test_backoff_Do(t *testing.T) {
func() test {
ctx := context.Background()
err := errors.New("erros is occurred")
- f := func(context.Context) (interface{}, bool, error) {
+ f := func(context.Context) (any, bool, error) {
return str, true, err
}
return test{
@@ -443,7 +443,7 @@ func Test_backoff_Do(t *testing.T) {
func() test {
ctx := context.Background()
err := errors.New("erros is occurred")
- f := func(context.Context) (interface{}, bool, error) {
+ f := func(context.Context) (any, bool, error) {
return str, true, err
}
return test{
@@ -471,7 +471,7 @@ func Test_backoff_Do(t *testing.T) {
func() test {
ctx, cancel := context.WithCancel(context.Background())
err := errors.New("erros is occurred")
- f := func(context.Context) (interface{}, bool, error) {
+ f := func(context.Context) (any, bool, error) {
cancel()
return str, true, err
}
@@ -501,7 +501,7 @@ func Test_backoff_Do(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
err := errors.New("erros is occurred")
cnt := 0
- f := func(context.Context) (interface{}, bool, error) {
+ f := func(context.Context) (any, bool, error) {
cnt++
if cnt > 1 {
cancel()
@@ -534,7 +534,7 @@ func Test_backoff_Do(t *testing.T) {
ctx := context.Background()
err := errors.New("erros is occurred")
cnt := 0
- f := func(context.Context) (interface{}, bool, error) {
+ f := func(context.Context) (any, bool, error) {
cnt++
if cnt > 1 {
time.Sleep(10 * time.Millisecond)
diff --git a/internal/cache/gache/gache.go b/internal/cache/gache/gache.go
index 24709f6d9c..246d70ae95 100644
--- a/internal/cache/gache/gache.go
+++ b/internal/cache/gache/gache.go
@@ -52,7 +52,7 @@ func (c *cache[V]) Start(ctx context.Context) {
c.gache.StartExpired(ctx, c.expireCheckDur)
}
-// Get calls StartExpired func of c.gache and returns (interface{}, bool) according to key.
+// Get calls StartExpired func of c.gache and returns (any, bool) according to key.
func (c *cache[V]) Get(key string) (V, bool) {
return c.gache.Get(key)
}
@@ -67,7 +67,7 @@ func (c *cache[V]) Delete(key string) {
c.gache.Delete(key)
}
-// GetAndDelete returns (interface{}, bool) and delete value according to key when value of key is set.
+// GetAndDelete returns (any, bool) and delete value according to key when value of key is set.
// When value of key is not set, returns (nil, false).
func (c *cache[V]) GetAndDelete(key string) (V, bool) {
v, ok := c.gache.Get(key)
diff --git a/internal/cache/gache/gache_test.go b/internal/cache/gache/gache_test.go
index 215ce14870..5a9fac4863 100644
--- a/internal/cache/gache/gache_test.go
+++ b/internal/cache/gache/gache_test.go
@@ -202,7 +202,7 @@ func Test_cache_Get(t *testing.T) {
expiredHook func(context.Context, string)
}
type want struct {
- want interface{}
+ want any
want1 bool
}
type test struct {
@@ -210,11 +210,11 @@ func Test_cache_Get(t *testing.T) {
args args
fields fields
want want
- checkFunc func(want, interface{}, bool) error
+ checkFunc func(want, any, bool) error
beforeFunc func(*testing.T, args, *cache[any])
afterFunc func(args)
}
- defaultCheckFunc := func(w want, got interface{}, got1 bool) error {
+ defaultCheckFunc := func(w want, got any, got1 bool) error {
if !reflect.DeepEqual(got, w.want) {
return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want)
}
@@ -293,7 +293,7 @@ func Test_cache_Get(t *testing.T) {
func Test_cache_Set(t *testing.T) {
type args struct {
key string
- val interface{}
+ val any
}
type fields struct {
gache gache.Gache[any]
@@ -303,7 +303,7 @@ func Test_cache_Set(t *testing.T) {
}
type want struct {
key string
- want interface{}
+ want any
want1 bool
}
type test struct {
@@ -387,7 +387,7 @@ func Test_cache_Delete(t *testing.T) {
}
type want struct {
key string
- want interface{}
+ want any
want1 bool
}
type test struct {
@@ -490,7 +490,7 @@ func Test_cache_GetAndDelete(t *testing.T) {
expiredHook func(context.Context, string)
}
type want struct {
- want interface{}
+ want any
want1 bool
}
type test struct {
@@ -498,11 +498,11 @@ func Test_cache_GetAndDelete(t *testing.T) {
args args
fields fields
want want
- checkFunc func(want, interface{}, bool) error
+ checkFunc func(want, any, bool) error
beforeFunc func(*testing.T, args, *cache[any])
afterFunc func(args)
}
- defaultCheckFunc := func(w want, got interface{}, got1 bool) error {
+ defaultCheckFunc := func(w want, got any, got1 bool) error {
if !reflect.DeepEqual(got, w.want) {
return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want)
}
diff --git a/internal/circuitbreaker/breaker.go b/internal/circuitbreaker/breaker.go
index 4f11ec5889..29c499c000 100644
--- a/internal/circuitbreaker/breaker.go
+++ b/internal/circuitbreaker/breaker.go
@@ -72,7 +72,9 @@ func newBreaker(key string, opts ...BreakerOption) (*breaker, error) {
// do executes the function given argument when the current breaker state is "Closed" or "Half-Open".
// If the current breaker state is "Open", this function returns ErrCircuitBreakerOpenState.
-func (b *breaker) do(ctx context.Context, fn func(ctx context.Context) (val interface{}, err error)) (val interface{}, st State, err error) {
+func (b *breaker) do(
+ ctx context.Context, fn func(ctx context.Context) (val any, err error),
+) (val any, st State, err error) {
if st, err := b.isReady(); err != nil {
b.count.onIgnore()
return nil, st, err
diff --git a/internal/circuitbreaker/breaker_test.go b/internal/circuitbreaker/breaker_test.go
index f02d299c4b..e521f84c14 100644
--- a/internal/circuitbreaker/breaker_test.go
+++ b/internal/circuitbreaker/breaker_test.go
@@ -552,7 +552,7 @@ func Test_breaker_fail(t *testing.T) {
// func Test_breaker_do(t *testing.T) {
// type args struct {
// ctx context.Context
-// fn func(ctx context.Context) (val interface{}, err error)
+// fn func(ctx context.Context) (val any, err error)
// }
// type fields struct {
// key string
@@ -569,7 +569,7 @@ func Test_breaker_fail(t *testing.T) {
// closedRefreshExp int64
// }
// type want struct {
-// wantVal interface{}
+// wantVal any
// wantSt State
// err error
// }
@@ -578,11 +578,11 @@ func Test_breaker_fail(t *testing.T) {
// args args
// fields fields
// want want
-// checkFunc func(want, interface{}, State, error) error
+// checkFunc func(want, any, State, error) error
// beforeFunc func(*testing.T, args)
// afterFunc func(*testing.T, args)
// }
-// defaultCheckFunc := func(w want, gotVal interface{}, gotSt State, err error) error {
+// defaultCheckFunc := func(w want, gotVal any, gotSt State, err error) error {
// if !errors.Is(err, w.err) {
// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err)
// }
diff --git a/internal/circuitbreaker/manager.go b/internal/circuitbreaker/manager.go
index 34bffe2ff2..756cfd1516 100644
--- a/internal/circuitbreaker/manager.go
+++ b/internal/circuitbreaker/manager.go
@@ -32,7 +32,7 @@ var (
// CircuitBreaker is a state machine to prevent doing processes that are likely to fail.
type CircuitBreaker interface {
- Do(ctx context.Context, key string, fn func(ctx context.Context) (interface{}, error)) (val interface{}, err error)
+ Do(ctx context.Context, key string, fn func(ctx context.Context) (any, error)) (val any, err error)
}
type breakerManager struct {
@@ -58,7 +58,9 @@ func NewCircuitBreaker(opts ...Option) (CircuitBreaker, error) {
}
// Do invokes the breaker matching the given key.
-func (bm *breakerManager) Do(ctx context.Context, key string, fn func(ctx context.Context) (interface{}, error)) (val interface{}, err error) {
+func (bm *breakerManager) Do(
+ ctx context.Context, key string, fn func(ctx context.Context) (any, error),
+) (val any, err error) {
var st State
defer func() {
mu.Lock()
diff --git a/internal/circuitbreaker/manager_test.go b/internal/circuitbreaker/manager_test.go
index 1f6c41a45f..cf587067db 100644
--- a/internal/circuitbreaker/manager_test.go
+++ b/internal/circuitbreaker/manager_test.go
@@ -109,14 +109,14 @@ package circuitbreaker
// type args struct {
// ctx context.Context
// key string
-// fn func(ctx context.Context) (interface{}, error)
+// fn func(ctx context.Context) (any, error)
// }
// type fields struct {
// m sync.Map[string, *breaker]
// opts []BreakerOption
// }
// type want struct {
-// wantVal interface{}
+// wantVal any
// err error
// }
// type test struct {
@@ -124,11 +124,11 @@ package circuitbreaker
// args args
// fields fields
// want want
-// checkFunc func(want, interface{}, error) error
+// checkFunc func(want, any, error) error
// beforeFunc func(*testing.T, args)
// afterFunc func(*testing.T, args)
// }
-// defaultCheckFunc := func(w want, gotVal interface{}, err error) error {
+// defaultCheckFunc := func(w want, gotVal any, err error) error {
// if !errors.Is(err, w.err) {
// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err)
// }
diff --git a/internal/client/v1/client/agent/core/client.go b/internal/client/v1/client/agent/core/client.go
index 4dfc45f55c..10874ac9b2 100644
--- a/internal/client/v1/client/agent/core/client.go
+++ b/internal/client/v1/client/agent/core/client.go
@@ -94,9 +94,7 @@ func NewAgentClient(cc *grpc.ClientConn) Client {
}
func (c *agentClient) CreateIndex(
- ctx context.Context,
- req *client.ControlCreateIndexRequest,
- _ ...grpc.CallOption,
+ ctx context.Context, req *client.ControlCreateIndexRequest, _ ...grpc.CallOption,
) (*client.Empty, error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+agent.CreateIndexRPCName), apiName+"/"+agent.CreateIndexRPCName)
defer func() {
@@ -106,16 +104,14 @@ func (c *agentClient) CreateIndex(
}()
_, err := c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn, copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
return agent.NewAgentClient(conn).CreateIndex(ctx, req, copts...)
})
return nil, err
}
func (c *agentClient) SaveIndex(
- ctx context.Context,
- _ *client.Empty,
- _ ...grpc.CallOption,
+ ctx context.Context, _ *client.Empty, _ ...grpc.CallOption,
) (*client.Empty, error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+agent.SaveIndexRPCName), apiName+"/"+agent.SaveIndexRPCName)
defer func() {
@@ -125,16 +121,14 @@ func (c *agentClient) SaveIndex(
}()
_, err := c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn, copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
return agent.NewAgentClient(conn).SaveIndex(ctx, new(client.Empty), copts...)
})
return nil, err
}
func (c *agentClient) CreateAndSaveIndex(
- ctx context.Context,
- req *client.ControlCreateIndexRequest,
- _ ...grpc.CallOption,
+ ctx context.Context, req *client.ControlCreateIndexRequest, _ ...grpc.CallOption,
) (*client.Empty, error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+agent.CreateAndSaveIndexRPCName), apiName+"/"+agent.CreateAndSaveIndexRPCName)
defer func() {
@@ -144,68 +138,14 @@ func (c *agentClient) CreateAndSaveIndex(
}()
_, err := c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn, copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
return agent.NewAgentClient(conn).CreateAndSaveIndex(ctx, req, copts...)
})
return nil, err
}
-func (c *agentClient) IndexInfo(
- ctx context.Context,
- _ *client.Empty,
- _ ...grpc.CallOption,
-) (res *client.InfoIndexCount, err error) {
- ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+agent.IndexInfoRPCName), apiName+"/"+agent.IndexInfoRPCName)
- defer func() {
- if span != nil {
- span.End()
- }
- }()
- _, err = c.c.RoundRobin(ctx, func(ctx context.Context,
- conn *grpc.ClientConn, copts ...grpc.CallOption,
- ) (interface{}, error) {
- res, err := agent.NewAgentClient(conn).IndexInfo(ctx, new(client.Empty), copts...)
- if err != nil {
- return nil, err
- }
- return res, err
- })
- if err != nil {
- return nil, err
- }
- return res, nil
-}
-
-func (c *agentClient) GetTimestamp(
- ctx context.Context,
- req *client.ObjectGetTimestampRequest,
- _ ...grpc.CallOption,
-) (res *client.ObjectTimestamp, err error) {
- ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+agent.GetTimestampRPCName), apiName+"/"+agent.GetTimestampRPCName)
- defer func() {
- if span != nil {
- span.End()
- }
- }()
- _, err = c.c.RoundRobin(ctx, func(ctx context.Context,
- conn *grpc.ClientConn, copts ...grpc.CallOption,
- ) (interface{}, error) {
- res, err := agent.NewAgentClient(conn).GetTimestamp(ctx, req, copts...)
- if err != nil {
- return nil, err
- }
- return res, err
- })
- if err != nil {
- return nil, err
- }
- return res, nil
-}
-
func (c *singleAgentClient) CreateIndex(
- ctx context.Context,
- req *client.ControlCreateIndexRequest,
- opts ...grpc.CallOption,
+ ctx context.Context, req *client.ControlCreateIndexRequest, opts ...grpc.CallOption,
) (*client.Empty, error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+agent.CreateIndexRPCName), apiName+"/"+agent.CreateIndexRPCName)
defer func() {
@@ -217,9 +157,7 @@ func (c *singleAgentClient) CreateIndex(
}
func (c *singleAgentClient) SaveIndex(
- ctx context.Context,
- _ *client.Empty,
- opts ...grpc.CallOption,
+ ctx context.Context, _ *client.Empty, opts ...grpc.CallOption,
) (*client.Empty, error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+agent.SaveIndexRPCName), apiName+"/"+agent.SaveIndexRPCName)
defer func() {
@@ -231,9 +169,7 @@ func (c *singleAgentClient) SaveIndex(
}
func (c *singleAgentClient) CreateAndSaveIndex(
- ctx context.Context,
- req *client.ControlCreateIndexRequest,
- opts ...grpc.CallOption,
+ ctx context.Context, req *client.ControlCreateIndexRequest, opts ...grpc.CallOption,
) (*client.Empty, error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+agent.CreateAndSaveIndexRPCName), apiName+"/"+agent.CreateAndSaveIndexRPCName)
defer func() {
@@ -243,31 +179,3 @@ func (c *singleAgentClient) CreateAndSaveIndex(
}()
return c.ac.CreateAndSaveIndex(ctx, req, opts...)
}
-
-func (c *singleAgentClient) IndexInfo(
- ctx context.Context,
- _ *client.Empty,
- opts ...grpc.CallOption,
-) (res *client.InfoIndexCount, err error) {
- ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+agent.IndexInfoRPCName), apiName+"/"+agent.IndexInfoRPCName)
- defer func() {
- if span != nil {
- span.End()
- }
- }()
- return c.ac.IndexInfo(ctx, new(client.Empty), opts...)
-}
-
-func (c *singleAgentClient) GetTimestamp(
- ctx context.Context,
- req *client.ObjectGetTimestampRequest,
- opts ...grpc.CallOption,
-) (res *client.ObjectTimestamp, err error) {
- ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+agent.GetTimestampRPCName), apiName+"/"+agent.GetTimestampRPCName)
- defer func() {
- if span != nil {
- span.End()
- }
- }()
- return c.ac.GetTimestamp(ctx, req, opts...)
-}
diff --git a/internal/client/v1/client/agent/core/client_test.go b/internal/client/v1/client/agent/core/client_test.go
index 6f37d9cb93..525a1a055b 100644
--- a/internal/client/v1/client/agent/core/client_test.go
+++ b/internal/client/v1/client/agent/core/client_test.go
@@ -678,7 +678,7 @@ package core
// func Test_agentClient_GetTimestamp(t *testing.T) {
// type args struct {
// ctx context.Context
-// req *client.ObjectGetTimestampRequest
+// req *client.ObjectTimestampRequest
// in2 []grpc.CallOption
// }
// type fields struct {
@@ -1247,7 +1247,7 @@ package core
// func Test_singleAgentClient_GetTimestamp(t *testing.T) {
// type args struct {
// ctx context.Context
-// req *client.ObjectGetTimestampRequest
+// req *client.ObjectTimestampRequest
// opts []grpc.CallOption
// }
// type fields struct {
diff --git a/internal/client/v1/client/client.go b/internal/client/v1/client/client.go
index 3416aca136..4c3b71363b 100644
--- a/internal/client/v1/client/client.go
+++ b/internal/client/v1/client/client.go
@@ -51,7 +51,7 @@ type (
SearchConfig = payload.Search_Config
ObjectDistance = payload.Object_Distance
ObjectTimestamp = payload.Object_Timestamp
- ObjectGetTimestampRequest = payload.Object_GetTimestampRequest
+ ObjectTimestampRequest = payload.Object_TimestampRequest
Searcher = vald.SearchClient
Inserter = vald.InsertClient
diff --git a/internal/client/v1/client/discoverer/discover.go b/internal/client/v1/client/discoverer/discover.go
index 32b0d86ebb..83c98c46db 100644
--- a/internal/client/v1/client/discoverer/discover.go
+++ b/internal/client/v1/client/discoverer/discover.go
@@ -271,7 +271,7 @@ func (c *client) discover(ctx context.Context, ech chan<- error) (err error) {
var connected []string
if bo := c.client.GetBackoff(); bo != nil {
- _, err = bo.Do(ctx, func(ctx context.Context) (interface{}, bool, error) {
+ _, err = bo.Do(ctx, func(ctx context.Context) (any, bool, error) {
connected, err = c.updateDiscoveryInfo(ctx, ech)
if err != nil {
if !errors.Is(err, errors.ErrGRPCClientNotFound) &&
@@ -298,7 +298,9 @@ func (c *client) discover(ctx context.Context, ech chan<- error) (err error) {
return c.disconnectOldAddrs(ctx, oldAddrs, connected, ech)
}
-func (c *client) updateDiscoveryInfo(ctx context.Context, ech chan<- error) (connected []string, err error) {
+func (c *client) updateDiscoveryInfo(
+ ctx context.Context, ech chan<- error,
+) (connected []string, err error) {
nodes, err := c.discoverNodes(ctx)
if err != nil {
log.Warnf("error detected when discovering nodes,\terrors: %v", err)
@@ -329,7 +331,7 @@ func (c *client) updateDiscoveryInfo(ctx context.Context, ech chan<- error) (con
func (c *client) discoverNodes(ctx context.Context) (nodes *payload.Info_Nodes, err error) {
_, err = c.dscClient.RoundRobin(grpc.WithGRPCMethod(ctx, "discoverer.v1.Discoverer/Nodes"), func(ctx context.Context,
conn *grpc.ClientConn, copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
nodes, err = discoverer.NewDiscovererClient(conn).
Nodes(ctx, &payload.Discoverer_Request{
Namespace: c.namespace,
@@ -344,7 +346,9 @@ func (c *client) discoverNodes(ctx context.Context) (nodes *payload.Info_Nodes,
return nodes, err
}
-func (c *client) discoverAddrs(ctx context.Context, nodes *payload.Info_Nodes, ech chan<- error) (addrs []string, err error) {
+func (c *client) discoverAddrs(
+ ctx context.Context, nodes *payload.Info_Nodes, ech chan<- error,
+) (addrs []string, err error) {
maxPodLen := 0
podLength := 0
for _, node := range nodes.GetNodes() {
@@ -383,7 +387,9 @@ func (c *client) discoverAddrs(ctx context.Context, nodes *payload.Info_Nodes, e
return addrs, nil
}
-func (c *client) disconnectOldAddrs(ctx context.Context, oldAddrs, connectedAddrs []string, ech chan<- error) (err error) {
+func (c *client) disconnectOldAddrs(
+ ctx context.Context, oldAddrs, connectedAddrs []string, ech chan<- error,
+) (err error) {
if !c.autoconn {
return nil
}
diff --git a/internal/client/v1/client/filter/egress/client.go b/internal/client/v1/client/filter/egress/client.go
index 6fbc8fcf8e..3e550db635 100644
--- a/internal/client/v1/client/filter/egress/client.go
+++ b/internal/client/v1/client/filter/egress/client.go
@@ -130,7 +130,9 @@ func (c *client) Target(ctx context.Context, targets ...string) (egress.FilterCl
}, nil
}
-func (c *client) FilterDistance(ctx context.Context, in *payload.Object_Distance, opts ...grpc.CallOption) (res *payload.Object_Distance, err error) {
+func (c *client) FilterDistance(
+ ctx context.Context, in *payload.Object_Distance, opts ...grpc.CallOption,
+) (res *payload.Object_Distance, err error) {
ctx, span := trace.StartSpan(ctx, apiName+"/Client.FilterDistance")
defer func() {
if span != nil {
@@ -140,7 +142,7 @@ func (c *client) FilterDistance(ctx context.Context, in *payload.Object_Distance
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = egress.NewFilterClient(conn).FilterDistance(ctx, in, append(copts, opts...)...)
return nil, err
})
@@ -150,7 +152,9 @@ func (c *client) FilterDistance(ctx context.Context, in *payload.Object_Distance
return res, nil
}
-func (s *specificAddrClient) FilterDistance(ctx context.Context, in *payload.Object_Distance, opts ...grpc.CallOption) (res *payload.Object_Distance, err error) {
+func (s *specificAddrClient) FilterDistance(
+ ctx context.Context, in *payload.Object_Distance, opts ...grpc.CallOption,
+) (res *payload.Object_Distance, err error) {
ctx, span := trace.StartSpan(ctx, apiName+"/Client.FilterDistance/"+s.addr)
defer func() {
if span != nil {
@@ -160,7 +164,7 @@ func (s *specificAddrClient) FilterDistance(ctx context.Context, in *payload.Obj
_, err = s.c.Do(ctx, s.addr, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = egress.NewFilterClient(conn).FilterDistance(ctx, in, append(copts, opts...)...)
if err != nil {
return nil, err
@@ -174,7 +178,9 @@ func (s *specificAddrClient) FilterDistance(ctx context.Context, in *payload.Obj
return res, nil
}
-func (m *multipleAddrsClient) FilterDistance(ctx context.Context, in *payload.Object_Distance, opts ...grpc.CallOption) (res *payload.Object_Distance, err error) {
+func (m *multipleAddrsClient) FilterDistance(
+ ctx context.Context, in *payload.Object_Distance, opts ...grpc.CallOption,
+) (res *payload.Object_Distance, err error) {
ctx, span := trace.StartSpan(ctx, apiName+"/Client.FilterDistance/["+strings.Join(m.addrs, ",")+"]")
defer func() {
if span != nil {
@@ -198,7 +204,9 @@ func (m *multipleAddrsClient) FilterDistance(ctx context.Context, in *payload.Ob
return res, nil
}
-func (c *client) FilterVector(ctx context.Context, in *payload.Object_Vector, opts ...grpc.CallOption) (res *payload.Object_Vector, err error) {
+func (c *client) FilterVector(
+ ctx context.Context, in *payload.Object_Vector, opts ...grpc.CallOption,
+) (res *payload.Object_Vector, err error) {
ctx, span := trace.StartSpan(ctx, apiName+"/Client.FilterVector")
defer func() {
if span != nil {
@@ -208,7 +216,7 @@ func (c *client) FilterVector(ctx context.Context, in *payload.Object_Vector, op
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = egress.NewFilterClient(conn).FilterVector(ctx, in, append(copts, opts...)...)
return nil, err
})
@@ -218,7 +226,9 @@ func (c *client) FilterVector(ctx context.Context, in *payload.Object_Vector, op
return res, nil
}
-func (s *specificAddrClient) FilterVector(ctx context.Context, in *payload.Object_Vector, opts ...grpc.CallOption) (res *payload.Object_Vector, err error) {
+func (s *specificAddrClient) FilterVector(
+ ctx context.Context, in *payload.Object_Vector, opts ...grpc.CallOption,
+) (res *payload.Object_Vector, err error) {
ctx, span := trace.StartSpan(ctx, apiName+"/Client.FilterVector/"+s.addr)
defer func() {
if span != nil {
@@ -228,7 +238,7 @@ func (s *specificAddrClient) FilterVector(ctx context.Context, in *payload.Objec
_, err = s.c.Do(ctx, s.addr, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = egress.NewFilterClient(conn).FilterVector(ctx, in, append(copts, opts...)...)
if err != nil {
return nil, err
@@ -242,7 +252,9 @@ func (s *specificAddrClient) FilterVector(ctx context.Context, in *payload.Objec
return res, nil
}
-func (m *multipleAddrsClient) FilterVector(ctx context.Context, in *payload.Object_Vector, opts ...grpc.CallOption) (res *payload.Object_Vector, err error) {
+func (m *multipleAddrsClient) FilterVector(
+ ctx context.Context, in *payload.Object_Vector, opts ...grpc.CallOption,
+) (res *payload.Object_Vector, err error) {
ctx, span := trace.StartSpan(ctx, apiName+"/Client.FilterVector/["+strings.Join(m.addrs, ",")+"]")
defer func() {
if span != nil {
diff --git a/internal/client/v1/client/filter/ingress/client.go b/internal/client/v1/client/filter/ingress/client.go
index 68cac7523e..56c88e5887 100644
--- a/internal/client/v1/client/filter/ingress/client.go
+++ b/internal/client/v1/client/filter/ingress/client.go
@@ -130,7 +130,9 @@ func (c *client) Target(ctx context.Context, targets ...string) (ingress.FilterC
}, nil
}
-func (c *client) GenVector(ctx context.Context, in *payload.Object_Blob, opts ...grpc.CallOption) (res *payload.Object_Vector, err error) {
+func (c *client) GenVector(
+ ctx context.Context, in *payload.Object_Blob, opts ...grpc.CallOption,
+) (res *payload.Object_Vector, err error) {
ctx, span := trace.StartSpan(ctx, apiName+"/Client.GenVector")
defer func() {
if span != nil {
@@ -140,7 +142,7 @@ func (c *client) GenVector(ctx context.Context, in *payload.Object_Blob, opts ..
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = ingress.NewFilterClient(conn).GenVector(ctx, in, append(copts, opts...)...)
return nil, err
})
@@ -150,7 +152,9 @@ func (c *client) GenVector(ctx context.Context, in *payload.Object_Blob, opts ..
return res, nil
}
-func (c *client) FilterVector(ctx context.Context, in *payload.Object_Vector, opts ...grpc.CallOption) (res *payload.Object_Vector, err error) {
+func (c *client) FilterVector(
+ ctx context.Context, in *payload.Object_Vector, opts ...grpc.CallOption,
+) (res *payload.Object_Vector, err error) {
ctx, span := trace.StartSpan(ctx, apiName+"/Client.FilterVector")
defer func() {
if span != nil {
@@ -160,7 +164,7 @@ func (c *client) FilterVector(ctx context.Context, in *payload.Object_Vector, op
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = ingress.NewFilterClient(conn).FilterVector(ctx, in, append(copts, opts...)...)
return nil, err
})
@@ -170,7 +174,9 @@ func (c *client) FilterVector(ctx context.Context, in *payload.Object_Vector, op
return res, nil
}
-func (s *specificAddrClient) GenVector(ctx context.Context, in *payload.Object_Blob, opts ...grpc.CallOption) (res *payload.Object_Vector, err error) {
+func (s *specificAddrClient) GenVector(
+ ctx context.Context, in *payload.Object_Blob, opts ...grpc.CallOption,
+) (res *payload.Object_Vector, err error) {
ctx, span := trace.StartSpan(ctx, apiName+"/Client.GenVector/"+s.addr)
defer func() {
if span != nil {
@@ -180,7 +186,7 @@ func (s *specificAddrClient) GenVector(ctx context.Context, in *payload.Object_B
_, err = s.c.Do(ctx, s.addr, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = ingress.NewFilterClient(conn).GenVector(ctx, in, append(copts, opts...)...)
return nil, err
})
@@ -190,7 +196,9 @@ func (s *specificAddrClient) GenVector(ctx context.Context, in *payload.Object_B
return res, nil
}
-func (s *specificAddrClient) FilterVector(ctx context.Context, in *payload.Object_Vector, opts ...grpc.CallOption) (res *payload.Object_Vector, err error) {
+func (s *specificAddrClient) FilterVector(
+ ctx context.Context, in *payload.Object_Vector, opts ...grpc.CallOption,
+) (res *payload.Object_Vector, err error) {
ctx, span := trace.StartSpan(ctx, apiName+"/Client.FilterVector/"+s.addr)
defer func() {
if span != nil {
@@ -200,7 +208,7 @@ func (s *specificAddrClient) FilterVector(ctx context.Context, in *payload.Objec
_, err = s.c.Do(ctx, s.addr, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = ingress.NewFilterClient(conn).FilterVector(ctx, in, append(copts, opts...)...)
return nil, err
})
@@ -210,7 +218,9 @@ func (s *specificAddrClient) FilterVector(ctx context.Context, in *payload.Objec
return res, nil
}
-func (m *multipleAddrsClient) GenVector(ctx context.Context, in *payload.Object_Blob, opts ...grpc.CallOption) (res *payload.Object_Vector, err error) {
+func (m *multipleAddrsClient) GenVector(
+ ctx context.Context, in *payload.Object_Blob, opts ...grpc.CallOption,
+) (res *payload.Object_Vector, err error) {
ctx, span := trace.StartSpan(ctx, apiName+"/Client.GetVector/["+strings.Join(m.addrs, ",")+"]")
defer func() {
if span != nil {
@@ -220,7 +230,7 @@ func (m *multipleAddrsClient) GenVector(ctx context.Context, in *payload.Object_
_, err = m.c.Do(ctx, m.addrs[0], func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = ingress.NewFilterClient(conn).GenVector(ctx, in, append(copts, opts...)...)
return nil, err
})
@@ -230,7 +240,9 @@ func (m *multipleAddrsClient) GenVector(ctx context.Context, in *payload.Object_
return res, nil
}
-func (m *multipleAddrsClient) FilterVector(ctx context.Context, in *payload.Object_Vector, opts ...grpc.CallOption) (res *payload.Object_Vector, err error) {
+func (m *multipleAddrsClient) FilterVector(
+ ctx context.Context, in *payload.Object_Vector, opts ...grpc.CallOption,
+) (res *payload.Object_Vector, err error) {
ctx, span := trace.StartSpan(ctx, apiName+"/Client.FilterVector/["+strings.Join(m.addrs, ",")+"]")
defer func() {
if span != nil {
diff --git a/internal/client/v1/client/mirror/mirror.go b/internal/client/v1/client/mirror/mirror.go
index 616de1fabc..de28b66eb2 100644
--- a/internal/client/v1/client/mirror/mirror.go
+++ b/internal/client/v1/client/mirror/mirror.go
@@ -67,7 +67,9 @@ func (c *client) GRPCClient() grpc.Client {
return c.c
}
-func (c *client) Register(ctx context.Context, in *payload.Mirror_Targets, opts ...grpc.CallOption) (res *payload.Mirror_Targets, err error) {
+func (c *client) Register(
+ ctx context.Context, in *payload.Mirror_Targets, opts ...grpc.CallOption,
+) (res *payload.Mirror_Targets, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+mirror.RegisterRPCName), apiName+"/"+mirror.RegisterRPCName)
defer func() {
if span != nil {
@@ -75,7 +77,7 @@ func (c *client) Register(ctx context.Context, in *payload.Mirror_Targets, opts
}
}()
- _, err = c.c.RoundRobin(ctx, func(ctx context.Context, conn *grpc.ClientConn, copts ...grpc.CallOption) (interface{}, error) {
+ _, err = c.c.RoundRobin(ctx, func(ctx context.Context, conn *grpc.ClientConn, copts ...grpc.CallOption) (any, error) {
res, err = mirror.NewMirrorClient(conn).Register(ctx, in, append(copts, opts...)...)
if err != nil {
return nil, err
diff --git a/internal/client/v1/client/mirror/option.go b/internal/client/v1/client/mirror/option.go
index 4d671a8771..981dd69f81 100644
--- a/internal/client/v1/client/mirror/option.go
+++ b/internal/client/v1/client/mirror/option.go
@@ -13,9 +13,7 @@
// limitations under the License.
package mirror
-import (
- "github.com/vdaas/vald/internal/net/grpc"
-)
+import "github.com/vdaas/vald/internal/net/grpc"
type Option func(c *client) error
diff --git a/internal/client/v1/client/vald/vald.go b/internal/client/v1/client/vald/vald.go
index 0cc5b2b87a..6e5220d344 100644
--- a/internal/client/v1/client/vald/vald.go
+++ b/internal/client/v1/client/vald/vald.go
@@ -81,7 +81,9 @@ func (c *client) GRPCClient() grpc.Client {
return c.c
}
-func (c *client) Exists(ctx context.Context, in *payload.Object_ID, opts ...grpc.CallOption) (oid *payload.Object_ID, err error) {
+func (c *client) Exists(
+ ctx context.Context, in *payload.Object_ID, opts ...grpc.CallOption,
+) (oid *payload.Object_ID, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.ExistsRPCName), apiName+"/"+vald.ExistsRPCName)
defer func() {
if span != nil {
@@ -91,7 +93,7 @@ func (c *client) Exists(ctx context.Context, in *payload.Object_ID, opts ...grpc
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
oid, err = vald.NewValdClient(conn).Exists(ctx, in, append(copts, opts...)...)
return nil, err
})
@@ -101,7 +103,9 @@ func (c *client) Exists(ctx context.Context, in *payload.Object_ID, opts ...grpc
return oid, nil
}
-func (c *client) Search(ctx context.Context, in *payload.Search_Request, opts ...grpc.CallOption) (res *payload.Search_Response, err error) {
+func (c *client) Search(
+ ctx context.Context, in *payload.Search_Request, opts ...grpc.CallOption,
+) (res *payload.Search_Response, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.SearchRPCName), apiName+"/"+vald.SearchRPCName)
defer func() {
if span != nil {
@@ -111,7 +115,7 @@ func (c *client) Search(ctx context.Context, in *payload.Search_Request, opts ..
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = vald.NewValdClient(conn).Search(ctx, in, append(copts, opts...)...)
return nil, err
})
@@ -121,7 +125,9 @@ func (c *client) Search(ctx context.Context, in *payload.Search_Request, opts ..
return res, nil
}
-func (c *client) SearchByID(ctx context.Context, in *payload.Search_IDRequest, opts ...grpc.CallOption) (res *payload.Search_Response, err error) {
+func (c *client) SearchByID(
+ ctx context.Context, in *payload.Search_IDRequest, opts ...grpc.CallOption,
+) (res *payload.Search_Response, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.SearchByIDRPCName), apiName+"/"+vald.SearchByIDRPCName)
defer func() {
if span != nil {
@@ -131,7 +137,7 @@ func (c *client) SearchByID(ctx context.Context, in *payload.Search_IDRequest, o
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = vald.NewValdClient(conn).SearchByID(ctx, in, append(copts, opts...)...)
return nil, err
})
@@ -141,7 +147,9 @@ func (c *client) SearchByID(ctx context.Context, in *payload.Search_IDRequest, o
return res, nil
}
-func (c *client) StreamSearch(ctx context.Context, opts ...grpc.CallOption) (res vald.Search_StreamSearchClient, err error) {
+func (c *client) StreamSearch(
+ ctx context.Context, opts ...grpc.CallOption,
+) (res vald.Search_StreamSearchClient, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.StreamSearchRPCName), apiName+"/"+vald.StreamSearchRPCName)
defer func() {
if span != nil {
@@ -151,7 +159,7 @@ func (c *client) StreamSearch(ctx context.Context, opts ...grpc.CallOption) (res
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = vald.NewValdClient(conn).StreamSearch(ctx, append(copts, opts...)...)
return nil, err
})
@@ -161,7 +169,9 @@ func (c *client) StreamSearch(ctx context.Context, opts ...grpc.CallOption) (res
return res, nil
}
-func (c *client) StreamSearchByID(ctx context.Context, opts ...grpc.CallOption) (res vald.Search_StreamSearchByIDClient, err error) {
+func (c *client) StreamSearchByID(
+ ctx context.Context, opts ...grpc.CallOption,
+) (res vald.Search_StreamSearchByIDClient, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.StreamSearchByIDRPCName), apiName+"/"+vald.StreamSearchByIDRPCName)
defer func() {
if span != nil {
@@ -171,7 +181,7 @@ func (c *client) StreamSearchByID(ctx context.Context, opts ...grpc.CallOption)
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = vald.NewValdClient(conn).StreamSearchByID(ctx, append(copts, opts...)...)
return nil, err
})
@@ -181,7 +191,9 @@ func (c *client) StreamSearchByID(ctx context.Context, opts ...grpc.CallOption)
return res, nil
}
-func (c *client) MultiSearch(ctx context.Context, in *payload.Search_MultiRequest, opts ...grpc.CallOption) (res *payload.Search_Responses, err error) {
+func (c *client) MultiSearch(
+ ctx context.Context, in *payload.Search_MultiRequest, opts ...grpc.CallOption,
+) (res *payload.Search_Responses, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.MultiSearchRPCName), apiName+"/"+vald.MultiSearchRPCName)
defer func() {
if span != nil {
@@ -191,7 +203,7 @@ func (c *client) MultiSearch(ctx context.Context, in *payload.Search_MultiReques
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = vald.NewValdClient(conn).MultiSearch(ctx, in, append(copts, opts...)...)
return nil, err
})
@@ -201,7 +213,9 @@ func (c *client) MultiSearch(ctx context.Context, in *payload.Search_MultiReques
return res, nil
}
-func (c *client) MultiSearchByID(ctx context.Context, in *payload.Search_MultiIDRequest, opts ...grpc.CallOption) (res *payload.Search_Responses, err error) {
+func (c *client) MultiSearchByID(
+ ctx context.Context, in *payload.Search_MultiIDRequest, opts ...grpc.CallOption,
+) (res *payload.Search_Responses, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.MultiSearchByIDRPCName), apiName+"/"+vald.MultiSearchByIDRPCName)
defer func() {
if span != nil {
@@ -211,7 +225,7 @@ func (c *client) MultiSearchByID(ctx context.Context, in *payload.Search_MultiID
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = vald.NewValdClient(conn).MultiSearchByID(ctx, in, append(copts, opts...)...)
return nil, err
})
@@ -221,7 +235,9 @@ func (c *client) MultiSearchByID(ctx context.Context, in *payload.Search_MultiID
return res, nil
}
-func (c *client) LinearSearch(ctx context.Context, in *payload.Search_Request, opts ...grpc.CallOption) (res *payload.Search_Response, err error) {
+func (c *client) LinearSearch(
+ ctx context.Context, in *payload.Search_Request, opts ...grpc.CallOption,
+) (res *payload.Search_Response, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.LinearSearchRPCName), apiName+"/"+vald.LinearSearchRPCName)
defer func() {
if span != nil {
@@ -231,7 +247,7 @@ func (c *client) LinearSearch(ctx context.Context, in *payload.Search_Request, o
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = vald.NewValdClient(conn).LinearSearch(ctx, in, append(copts, opts...)...)
return nil, err
})
@@ -241,7 +257,9 @@ func (c *client) LinearSearch(ctx context.Context, in *payload.Search_Request, o
return res, nil
}
-func (c *client) LinearSearchByID(ctx context.Context, in *payload.Search_IDRequest, opts ...grpc.CallOption) (res *payload.Search_Response, err error) {
+func (c *client) LinearSearchByID(
+ ctx context.Context, in *payload.Search_IDRequest, opts ...grpc.CallOption,
+) (res *payload.Search_Response, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.LinearSearchByIDRPCName), apiName+"/"+vald.LinearSearchByIDRPCName)
defer func() {
if span != nil {
@@ -251,7 +269,7 @@ func (c *client) LinearSearchByID(ctx context.Context, in *payload.Search_IDRequ
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = vald.NewValdClient(conn).LinearSearchByID(ctx, in, append(copts, opts...)...)
return nil, err
})
@@ -261,7 +279,9 @@ func (c *client) LinearSearchByID(ctx context.Context, in *payload.Search_IDRequ
return res, nil
}
-func (c *client) StreamLinearSearch(ctx context.Context, opts ...grpc.CallOption) (res vald.Search_StreamLinearSearchClient, err error) {
+func (c *client) StreamLinearSearch(
+ ctx context.Context, opts ...grpc.CallOption,
+) (res vald.Search_StreamLinearSearchClient, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.StreamSearchRPCName), apiName+"/"+vald.StreamSearchRPCName)
defer func() {
if span != nil {
@@ -271,7 +291,7 @@ func (c *client) StreamLinearSearch(ctx context.Context, opts ...grpc.CallOption
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = vald.NewValdClient(conn).StreamLinearSearch(ctx, append(copts, opts...)...)
return nil, err
})
@@ -281,7 +301,9 @@ func (c *client) StreamLinearSearch(ctx context.Context, opts ...grpc.CallOption
return res, nil
}
-func (c *client) StreamLinearSearchByID(ctx context.Context, opts ...grpc.CallOption) (res vald.Search_StreamLinearSearchByIDClient, err error) {
+func (c *client) StreamLinearSearchByID(
+ ctx context.Context, opts ...grpc.CallOption,
+) (res vald.Search_StreamLinearSearchByIDClient, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.StreamSearchByIDRPCName), apiName+"/"+vald.StreamSearchByIDRPCName)
defer func() {
if span != nil {
@@ -291,7 +313,7 @@ func (c *client) StreamLinearSearchByID(ctx context.Context, opts ...grpc.CallOp
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = vald.NewValdClient(conn).StreamLinearSearchByID(ctx, append(copts, opts...)...)
return nil, err
})
@@ -301,7 +323,9 @@ func (c *client) StreamLinearSearchByID(ctx context.Context, opts ...grpc.CallOp
return res, nil
}
-func (c *client) MultiLinearSearch(ctx context.Context, in *payload.Search_MultiRequest, opts ...grpc.CallOption) (res *payload.Search_Responses, err error) {
+func (c *client) MultiLinearSearch(
+ ctx context.Context, in *payload.Search_MultiRequest, opts ...grpc.CallOption,
+) (res *payload.Search_Responses, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.MultiLinearSearchRPCName), apiName+"/"+vald.MultiLinearSearchRPCName)
defer func() {
if span != nil {
@@ -311,7 +335,7 @@ func (c *client) MultiLinearSearch(ctx context.Context, in *payload.Search_Multi
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = vald.NewValdClient(conn).MultiLinearSearch(ctx, in, append(copts, opts...)...)
return nil, err
})
@@ -321,7 +345,9 @@ func (c *client) MultiLinearSearch(ctx context.Context, in *payload.Search_Multi
return res, nil
}
-func (c *client) MultiLinearSearchByID(ctx context.Context, in *payload.Search_MultiIDRequest, opts ...grpc.CallOption) (res *payload.Search_Responses, err error) {
+func (c *client) MultiLinearSearchByID(
+ ctx context.Context, in *payload.Search_MultiIDRequest, opts ...grpc.CallOption,
+) (res *payload.Search_Responses, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.MultiLinearSearchByIDRPCName), apiName+"/"+vald.MultiLinearSearchByIDRPCName)
defer func() {
if span != nil {
@@ -331,7 +357,7 @@ func (c *client) MultiLinearSearchByID(ctx context.Context, in *payload.Search_M
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = vald.NewValdClient(conn).MultiLinearSearchByID(ctx, in, append(copts, opts...)...)
return nil, err
})
@@ -341,7 +367,9 @@ func (c *client) MultiLinearSearchByID(ctx context.Context, in *payload.Search_M
return res, nil
}
-func (c *client) Insert(ctx context.Context, in *payload.Insert_Request, opts ...grpc.CallOption) (res *payload.Object_Location, err error) {
+func (c *client) Insert(
+ ctx context.Context, in *payload.Insert_Request, opts ...grpc.CallOption,
+) (res *payload.Object_Location, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.InsertRPCName), apiName+"/"+vald.InsertRPCName)
defer func() {
if span != nil {
@@ -351,7 +379,7 @@ func (c *client) Insert(ctx context.Context, in *payload.Insert_Request, opts ..
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = vald.NewValdClient(conn).Insert(ctx, in, append(copts, opts...)...)
return nil, err
})
@@ -361,7 +389,9 @@ func (c *client) Insert(ctx context.Context, in *payload.Insert_Request, opts ..
return res, nil
}
-func (c *client) StreamInsert(ctx context.Context, opts ...grpc.CallOption) (res vald.Insert_StreamInsertClient, err error) {
+func (c *client) StreamInsert(
+ ctx context.Context, opts ...grpc.CallOption,
+) (res vald.Insert_StreamInsertClient, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.StreamInsertRPCName), apiName+"/"+vald.StreamInsertRPCName)
defer func() {
if span != nil {
@@ -371,7 +401,7 @@ func (c *client) StreamInsert(ctx context.Context, opts ...grpc.CallOption) (res
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = vald.NewValdClient(conn).StreamInsert(ctx, append(copts, opts...)...)
return nil, err
})
@@ -381,7 +411,9 @@ func (c *client) StreamInsert(ctx context.Context, opts ...grpc.CallOption) (res
return res, nil
}
-func (c *client) MultiInsert(ctx context.Context, in *payload.Insert_MultiRequest, opts ...grpc.CallOption) (res *payload.Object_Locations, err error) {
+func (c *client) MultiInsert(
+ ctx context.Context, in *payload.Insert_MultiRequest, opts ...grpc.CallOption,
+) (res *payload.Object_Locations, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.MultiInsertRPCName), apiName+"/"+vald.MultiInsertRPCName)
defer func() {
if span != nil {
@@ -391,7 +423,7 @@ func (c *client) MultiInsert(ctx context.Context, in *payload.Insert_MultiReques
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = vald.NewValdClient(conn).MultiInsert(ctx, in, append(copts, opts...)...)
return nil, err
})
@@ -401,7 +433,9 @@ func (c *client) MultiInsert(ctx context.Context, in *payload.Insert_MultiReques
return res, nil
}
-func (c *client) Update(ctx context.Context, in *payload.Update_Request, opts ...grpc.CallOption) (res *payload.Object_Location, err error) {
+func (c *client) Update(
+ ctx context.Context, in *payload.Update_Request, opts ...grpc.CallOption,
+) (res *payload.Object_Location, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.UpdateRPCName), apiName+"/"+vald.UpdateRPCName)
defer func() {
if span != nil {
@@ -411,7 +445,7 @@ func (c *client) Update(ctx context.Context, in *payload.Update_Request, opts ..
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = vald.NewValdClient(conn).Update(ctx, in, append(copts, opts...)...)
return nil, err
})
@@ -421,7 +455,9 @@ func (c *client) Update(ctx context.Context, in *payload.Update_Request, opts ..
return res, nil
}
-func (c *client) StreamUpdate(ctx context.Context, opts ...grpc.CallOption) (res vald.Update_StreamUpdateClient, err error) {
+func (c *client) StreamUpdate(
+ ctx context.Context, opts ...grpc.CallOption,
+) (res vald.Update_StreamUpdateClient, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.StreamUpdateRPCName), apiName+"/"+vald.StreamUpdateRPCName)
defer func() {
if span != nil {
@@ -431,7 +467,7 @@ func (c *client) StreamUpdate(ctx context.Context, opts ...grpc.CallOption) (res
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = vald.NewValdClient(conn).StreamUpdate(ctx, append(copts, opts...)...)
return nil, err
})
@@ -441,7 +477,9 @@ func (c *client) StreamUpdate(ctx context.Context, opts ...grpc.CallOption) (res
return res, nil
}
-func (c *client) MultiUpdate(ctx context.Context, in *payload.Update_MultiRequest, opts ...grpc.CallOption) (res *payload.Object_Locations, err error) {
+func (c *client) MultiUpdate(
+ ctx context.Context, in *payload.Update_MultiRequest, opts ...grpc.CallOption,
+) (res *payload.Object_Locations, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.MultiUpdateRPCName), apiName+"/"+vald.MultiUpdateRPCName)
defer func() {
if span != nil {
@@ -451,7 +489,7 @@ func (c *client) MultiUpdate(ctx context.Context, in *payload.Update_MultiReques
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = vald.NewValdClient(conn).MultiUpdate(ctx, in, append(copts, opts...)...)
return nil, err
})
@@ -461,7 +499,9 @@ func (c *client) MultiUpdate(ctx context.Context, in *payload.Update_MultiReques
return res, nil
}
-func (c *client) Upsert(ctx context.Context, in *payload.Upsert_Request, opts ...grpc.CallOption) (res *payload.Object_Location, err error) {
+func (c *client) Upsert(
+ ctx context.Context, in *payload.Upsert_Request, opts ...grpc.CallOption,
+) (res *payload.Object_Location, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.UpsertRPCName), apiName+"/"+vald.UpsertRPCName)
defer func() {
if span != nil {
@@ -471,7 +511,7 @@ func (c *client) Upsert(ctx context.Context, in *payload.Upsert_Request, opts ..
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = vald.NewValdClient(conn).Upsert(ctx, in, append(copts, opts...)...)
return nil, err
})
@@ -481,7 +521,9 @@ func (c *client) Upsert(ctx context.Context, in *payload.Upsert_Request, opts ..
return res, nil
}
-func (c *client) StreamUpsert(ctx context.Context, opts ...grpc.CallOption) (res vald.Upsert_StreamUpsertClient, err error) {
+func (c *client) StreamUpsert(
+ ctx context.Context, opts ...grpc.CallOption,
+) (res vald.Upsert_StreamUpsertClient, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.StreamUpsertRPCName), apiName+"/"+vald.StreamUpsertRPCName)
defer func() {
if span != nil {
@@ -491,7 +533,7 @@ func (c *client) StreamUpsert(ctx context.Context, opts ...grpc.CallOption) (res
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = vald.NewValdClient(conn).StreamUpsert(ctx, append(copts, opts...)...)
return nil, err
})
@@ -501,7 +543,9 @@ func (c *client) StreamUpsert(ctx context.Context, opts ...grpc.CallOption) (res
return res, nil
}
-func (c *client) MultiUpsert(ctx context.Context, in *payload.Upsert_MultiRequest, opts ...grpc.CallOption) (res *payload.Object_Locations, err error) {
+func (c *client) MultiUpsert(
+ ctx context.Context, in *payload.Upsert_MultiRequest, opts ...grpc.CallOption,
+) (res *payload.Object_Locations, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.MultiUpsertRPCName), apiName+"/"+vald.MultiUpsertRPCName)
defer func() {
if span != nil {
@@ -511,7 +555,7 @@ func (c *client) MultiUpsert(ctx context.Context, in *payload.Upsert_MultiReques
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = vald.NewValdClient(conn).MultiUpsert(ctx, in, append(copts, opts...)...)
return nil, err
})
@@ -521,7 +565,9 @@ func (c *client) MultiUpsert(ctx context.Context, in *payload.Upsert_MultiReques
return res, nil
}
-func (c *client) Remove(ctx context.Context, in *payload.Remove_Request, opts ...grpc.CallOption) (res *payload.Object_Location, err error) {
+func (c *client) Remove(
+ ctx context.Context, in *payload.Remove_Request, opts ...grpc.CallOption,
+) (res *payload.Object_Location, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.RemoveRPCName), apiName+"/"+vald.RemoveRPCName)
defer func() {
if span != nil {
@@ -531,7 +577,7 @@ func (c *client) Remove(ctx context.Context, in *payload.Remove_Request, opts ..
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = vald.NewValdClient(conn).Remove(ctx, in, append(copts, opts...)...)
return nil, err
})
@@ -541,7 +587,9 @@ func (c *client) Remove(ctx context.Context, in *payload.Remove_Request, opts ..
return res, nil
}
-func (c *client) StreamRemove(ctx context.Context, opts ...grpc.CallOption) (res vald.Remove_StreamRemoveClient, err error) {
+func (c *client) StreamRemove(
+ ctx context.Context, opts ...grpc.CallOption,
+) (res vald.Remove_StreamRemoveClient, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.StreamRemoveRPCName), apiName+"/"+vald.StreamRemoveRPCName)
defer func() {
if span != nil {
@@ -551,7 +599,7 @@ func (c *client) StreamRemove(ctx context.Context, opts ...grpc.CallOption) (res
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = vald.NewValdClient(conn).StreamRemove(ctx, append(copts, opts...)...)
return nil, err
})
@@ -561,7 +609,9 @@ func (c *client) StreamRemove(ctx context.Context, opts ...grpc.CallOption) (res
return res, nil
}
-func (c *client) MultiRemove(ctx context.Context, in *payload.Remove_MultiRequest, opts ...grpc.CallOption) (res *payload.Object_Locations, err error) {
+func (c *client) MultiRemove(
+ ctx context.Context, in *payload.Remove_MultiRequest, opts ...grpc.CallOption,
+) (res *payload.Object_Locations, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.MultiRemoveRPCName), apiName+"/"+vald.MultiRemoveRPCName)
defer func() {
if span != nil {
@@ -571,7 +621,7 @@ func (c *client) MultiRemove(ctx context.Context, in *payload.Remove_MultiReques
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = vald.NewValdClient(conn).MultiRemove(ctx, in, append(copts, opts...)...)
return nil, err
})
@@ -581,7 +631,9 @@ func (c *client) MultiRemove(ctx context.Context, in *payload.Remove_MultiReques
return res, nil
}
-func (c *client) Flush(ctx context.Context, in *payload.Flush_Request, opts ...grpc.CallOption) (res *payload.Info_Index_Count, err error) {
+func (c *client) Flush(
+ ctx context.Context, in *payload.Flush_Request, opts ...grpc.CallOption,
+) (res *payload.Info_Index_Count, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.FlushRPCName), apiName+"/"+vald.FlushRPCName)
defer func() {
if span != nil {
@@ -591,7 +643,7 @@ func (c *client) Flush(ctx context.Context, in *payload.Flush_Request, opts ...g
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = vald.NewValdClient(conn).Flush(ctx, in, append(copts, opts...)...)
return nil, err
})
@@ -601,7 +653,9 @@ func (c *client) Flush(ctx context.Context, in *payload.Flush_Request, opts ...g
return res, nil
}
-func (c *client) RemoveByTimestamp(ctx context.Context, in *payload.Remove_TimestampRequest, opts ...grpc.CallOption) (res *payload.Object_Locations, err error) {
+func (c *client) RemoveByTimestamp(
+ ctx context.Context, in *payload.Remove_TimestampRequest, opts ...grpc.CallOption,
+) (res *payload.Object_Locations, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.RemoveByTimestampRPCName), apiName+"/"+vald.RemoveByTimestampRPCName)
defer func() {
if span != nil {
@@ -611,7 +665,7 @@ func (c *client) RemoveByTimestamp(ctx context.Context, in *payload.Remove_Times
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = vald.NewValdClient(conn).RemoveByTimestamp(ctx, in, append(copts, opts...)...)
return nil, err
})
@@ -621,7 +675,9 @@ func (c *client) RemoveByTimestamp(ctx context.Context, in *payload.Remove_Times
return res, nil
}
-func (c *client) GetObject(ctx context.Context, in *payload.Object_VectorRequest, opts ...grpc.CallOption) (res *payload.Object_Vector, err error) {
+func (c *client) GetObject(
+ ctx context.Context, in *payload.Object_VectorRequest, opts ...grpc.CallOption,
+) (res *payload.Object_Vector, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.GetObjectRPCName), apiName+"/"+vald.GetObjectRPCName)
defer func() {
if span != nil {
@@ -631,7 +687,7 @@ func (c *client) GetObject(ctx context.Context, in *payload.Object_VectorRequest
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = vald.NewValdClient(conn).GetObject(ctx, in, append(copts, opts...)...)
return nil, err
})
@@ -641,7 +697,9 @@ func (c *client) GetObject(ctx context.Context, in *payload.Object_VectorRequest
return res, nil
}
-func (c *client) StreamGetObject(ctx context.Context, opts ...grpc.CallOption) (res vald.Object_StreamGetObjectClient, err error) {
+func (c *client) StreamGetObject(
+ ctx context.Context, opts ...grpc.CallOption,
+) (res vald.Object_StreamGetObjectClient, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.StreamGetObjectRPCName), apiName+"/"+vald.StreamGetObjectRPCName)
defer func() {
if span != nil {
@@ -651,7 +709,7 @@ func (c *client) StreamGetObject(ctx context.Context, opts ...grpc.CallOption) (
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
res, err = vald.NewValdClient(conn).StreamGetObject(ctx, append(copts, opts...)...)
return nil, err
})
@@ -661,7 +719,9 @@ func (c *client) StreamGetObject(ctx context.Context, opts ...grpc.CallOption) (
return res, nil
}
-func (c *client) StreamListObject(ctx context.Context, in *payload.Object_List_Request, opts ...grpc.CallOption) (res vald.Object_StreamListObjectClient, err error) {
+func (c *client) StreamListObject(
+ ctx context.Context, in *payload.Object_List_Request, opts ...grpc.CallOption,
+) (res vald.Object_StreamListObjectClient, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.StreamListObjectRPCName), apiName+"/"+vald.StreamListObjectRPCName)
defer func() {
if span != nil {
@@ -671,7 +731,7 @@ func (c *client) StreamListObject(ctx context.Context, in *payload.Object_List_R
_, err = c.c.RoundRobin(ctx, func(ctx context.Context,
conn *grpc.ClientConn,
copts ...grpc.CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
return vald.NewValdClient(conn).StreamListObject(ctx, in, append(copts, opts...)...)
})
if err != nil {
@@ -680,6 +740,72 @@ func (c *client) StreamListObject(ctx context.Context, in *payload.Object_List_R
return res, nil
}
+func (c *client) IndexInfo(
+ ctx context.Context, in *payload.Empty, opts ...grpc.CallOption,
+) (res *payload.Info_Index_Count, err error) {
+ ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.IndexInfoRPCName), apiName+"/"+vald.IndexInfoRPCName)
+ defer func() {
+ if span != nil {
+ span.End()
+ }
+ }()
+ _, err = c.c.RoundRobin(ctx, func(ctx context.Context,
+ conn *grpc.ClientConn,
+ copts ...grpc.CallOption,
+ ) (any, error) {
+ res, err = vald.NewValdClient(conn).IndexInfo(ctx, in, append(copts, opts...)...)
+ return nil, err
+ })
+ if err != nil {
+ return nil, err
+ }
+ return res, nil
+}
+
+func (c *client) IndexDetail(
+ ctx context.Context, in *payload.Empty, opts ...grpc.CallOption,
+) (res *payload.Info_Index_Detail, err error) {
+ ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.IndexDetailRPCName), apiName+"/"+vald.IndexDetailRPCName)
+ defer func() {
+ if span != nil {
+ span.End()
+ }
+ }()
+ _, err = c.c.RoundRobin(ctx, func(ctx context.Context,
+ conn *grpc.ClientConn,
+ copts ...grpc.CallOption,
+ ) (any, error) {
+ res, err = vald.NewValdClient(conn).IndexDetail(ctx, in, append(copts, opts...)...)
+ return nil, err
+ })
+ if err != nil {
+ return nil, err
+ }
+ return res, nil
+}
+
+func (c *client) GetTimestamp(
+ ctx context.Context, in *payload.Object_TimestampRequest, opts ...grpc.CallOption,
+) (res *payload.Object_Timestamp, err error) {
+ ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.GetTimestampRPCName), apiName+"/"+vald.GetTimestampRPCName)
+ defer func() {
+ if span != nil {
+ span.End()
+ }
+ }()
+ _, err = c.c.RoundRobin(ctx, func(ctx context.Context,
+ conn *grpc.ClientConn,
+ copts ...grpc.CallOption,
+ ) (any, error) {
+ res, err = vald.NewValdClient(conn).GetTimestamp(ctx, in, append(copts, opts...)...)
+ return nil, err
+ })
+ if err != nil {
+ return nil, err
+ }
+ return res, nil
+}
+
func (*singleClient) Start(context.Context) (<-chan error, error) {
return nil, nil
}
@@ -692,7 +818,9 @@ func (*singleClient) GRPCClient() grpc.Client {
return nil
}
-func (c *singleClient) Exists(ctx context.Context, in *payload.Object_ID, opts ...grpc.CallOption) (oid *payload.Object_ID, err error) {
+func (c *singleClient) Exists(
+ ctx context.Context, in *payload.Object_ID, opts ...grpc.CallOption,
+) (oid *payload.Object_ID, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.ExistsRPCName), apiName+"/"+vald.ExistsRPCName)
defer func() {
if span != nil {
@@ -702,7 +830,9 @@ func (c *singleClient) Exists(ctx context.Context, in *payload.Object_ID, opts .
return c.vc.Exists(ctx, in, opts...)
}
-func (c *singleClient) Search(ctx context.Context, in *payload.Search_Request, opts ...grpc.CallOption) (res *payload.Search_Response, err error) {
+func (c *singleClient) Search(
+ ctx context.Context, in *payload.Search_Request, opts ...grpc.CallOption,
+) (res *payload.Search_Response, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.SearchRPCName), apiName+"/"+vald.SearchRPCName)
defer func() {
if span != nil {
@@ -712,7 +842,9 @@ func (c *singleClient) Search(ctx context.Context, in *payload.Search_Request, o
return c.vc.Search(ctx, in, opts...)
}
-func (c *singleClient) SearchByID(ctx context.Context, in *payload.Search_IDRequest, opts ...grpc.CallOption) (res *payload.Search_Response, err error) {
+func (c *singleClient) SearchByID(
+ ctx context.Context, in *payload.Search_IDRequest, opts ...grpc.CallOption,
+) (res *payload.Search_Response, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.SearchByIDRPCName), apiName+"/"+vald.SearchByIDRPCName)
defer func() {
if span != nil {
@@ -722,7 +854,9 @@ func (c *singleClient) SearchByID(ctx context.Context, in *payload.Search_IDRequ
return c.vc.SearchByID(ctx, in, opts...)
}
-func (c *singleClient) StreamSearch(ctx context.Context, opts ...grpc.CallOption) (res vald.Search_StreamSearchClient, err error) {
+func (c *singleClient) StreamSearch(
+ ctx context.Context, opts ...grpc.CallOption,
+) (res vald.Search_StreamSearchClient, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.StreamSearchRPCName), apiName+"/"+vald.StreamSearchRPCName)
defer func() {
if span != nil {
@@ -732,7 +866,9 @@ func (c *singleClient) StreamSearch(ctx context.Context, opts ...grpc.CallOption
return c.vc.StreamSearch(ctx, opts...)
}
-func (c *singleClient) StreamSearchByID(ctx context.Context, opts ...grpc.CallOption) (res vald.Search_StreamSearchByIDClient, err error) {
+func (c *singleClient) StreamSearchByID(
+ ctx context.Context, opts ...grpc.CallOption,
+) (res vald.Search_StreamSearchByIDClient, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.StreamSearchByIDRPCName), apiName+"/"+vald.StreamSearchByIDRPCName)
defer func() {
if span != nil {
@@ -742,7 +878,9 @@ func (c *singleClient) StreamSearchByID(ctx context.Context, opts ...grpc.CallOp
return c.vc.StreamSearchByID(ctx, opts...)
}
-func (c *singleClient) MultiSearch(ctx context.Context, in *payload.Search_MultiRequest, opts ...grpc.CallOption) (res *payload.Search_Responses, err error) {
+func (c *singleClient) MultiSearch(
+ ctx context.Context, in *payload.Search_MultiRequest, opts ...grpc.CallOption,
+) (res *payload.Search_Responses, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.MultiSearchRPCName), apiName+"/"+vald.MultiSearchRPCName)
defer func() {
if span != nil {
@@ -752,7 +890,9 @@ func (c *singleClient) MultiSearch(ctx context.Context, in *payload.Search_Multi
return c.vc.MultiSearch(ctx, in, opts...)
}
-func (c *singleClient) MultiSearchByID(ctx context.Context, in *payload.Search_MultiIDRequest, opts ...grpc.CallOption) (res *payload.Search_Responses, err error) {
+func (c *singleClient) MultiSearchByID(
+ ctx context.Context, in *payload.Search_MultiIDRequest, opts ...grpc.CallOption,
+) (res *payload.Search_Responses, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.MultiSearchByIDRPCName), apiName+"/"+vald.MultiSearchByIDRPCName)
defer func() {
if span != nil {
@@ -762,7 +902,9 @@ func (c *singleClient) MultiSearchByID(ctx context.Context, in *payload.Search_M
return c.vc.MultiSearchByID(ctx, in, opts...)
}
-func (c *singleClient) LinearSearch(ctx context.Context, in *payload.Search_Request, opts ...grpc.CallOption) (res *payload.Search_Response, err error) {
+func (c *singleClient) LinearSearch(
+ ctx context.Context, in *payload.Search_Request, opts ...grpc.CallOption,
+) (res *payload.Search_Response, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.LinearSearchRPCName), apiName+"/"+vald.LinearSearchRPCName)
defer func() {
if span != nil {
@@ -772,7 +914,9 @@ func (c *singleClient) LinearSearch(ctx context.Context, in *payload.Search_Requ
return c.vc.LinearSearch(ctx, in, opts...)
}
-func (c *singleClient) LinearSearchByID(ctx context.Context, in *payload.Search_IDRequest, opts ...grpc.CallOption) (res *payload.Search_Response, err error) {
+func (c *singleClient) LinearSearchByID(
+ ctx context.Context, in *payload.Search_IDRequest, opts ...grpc.CallOption,
+) (res *payload.Search_Response, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.LinearSearchByIDRPCName), apiName+"/"+vald.LinearSearchByIDRPCName)
defer func() {
if span != nil {
@@ -782,7 +926,9 @@ func (c *singleClient) LinearSearchByID(ctx context.Context, in *payload.Search_
return c.vc.LinearSearchByID(ctx, in, opts...)
}
-func (c *singleClient) StreamLinearSearch(ctx context.Context, opts ...grpc.CallOption) (res vald.Search_StreamLinearSearchClient, err error) {
+func (c *singleClient) StreamLinearSearch(
+ ctx context.Context, opts ...grpc.CallOption,
+) (res vald.Search_StreamLinearSearchClient, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.StreamLinearSearchRPCName), apiName+"/"+vald.StreamLinearSearchRPCName)
defer func() {
if span != nil {
@@ -792,7 +938,9 @@ func (c *singleClient) StreamLinearSearch(ctx context.Context, opts ...grpc.Call
return c.vc.StreamLinearSearch(ctx, opts...)
}
-func (c *singleClient) StreamLinearSearchByID(ctx context.Context, opts ...grpc.CallOption) (res vald.Search_StreamLinearSearchByIDClient, err error) {
+func (c *singleClient) StreamLinearSearchByID(
+ ctx context.Context, opts ...grpc.CallOption,
+) (res vald.Search_StreamLinearSearchByIDClient, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.StreamLinearSearchByIDRPCName), apiName+"/"+vald.StreamLinearSearchByIDRPCName)
defer func() {
if span != nil {
@@ -802,7 +950,9 @@ func (c *singleClient) StreamLinearSearchByID(ctx context.Context, opts ...grpc.
return c.vc.StreamLinearSearchByID(ctx, opts...)
}
-func (c *singleClient) MultiLinearSearch(ctx context.Context, in *payload.Search_MultiRequest, opts ...grpc.CallOption) (res *payload.Search_Responses, err error) {
+func (c *singleClient) MultiLinearSearch(
+ ctx context.Context, in *payload.Search_MultiRequest, opts ...grpc.CallOption,
+) (res *payload.Search_Responses, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.MultiLinearSearchRPCName), apiName+"/"+vald.MultiLinearSearchRPCName)
defer func() {
if span != nil {
@@ -812,7 +962,9 @@ func (c *singleClient) MultiLinearSearch(ctx context.Context, in *payload.Search
return c.vc.MultiLinearSearch(ctx, in, opts...)
}
-func (c *singleClient) MultiLinearSearchByID(ctx context.Context, in *payload.Search_MultiIDRequest, opts ...grpc.CallOption) (res *payload.Search_Responses, err error) {
+func (c *singleClient) MultiLinearSearchByID(
+ ctx context.Context, in *payload.Search_MultiIDRequest, opts ...grpc.CallOption,
+) (res *payload.Search_Responses, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.MultiLinearSearchByIDRPCName), apiName+"/"+vald.MultiLinearSearchByIDRPCName)
defer func() {
if span != nil {
@@ -822,7 +974,9 @@ func (c *singleClient) MultiLinearSearchByID(ctx context.Context, in *payload.Se
return c.vc.MultiLinearSearchByID(ctx, in, opts...)
}
-func (c *singleClient) Insert(ctx context.Context, in *payload.Insert_Request, opts ...grpc.CallOption) (res *payload.Object_Location, err error) {
+func (c *singleClient) Insert(
+ ctx context.Context, in *payload.Insert_Request, opts ...grpc.CallOption,
+) (res *payload.Object_Location, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.InsertRPCName), apiName+"/"+vald.InsertRPCName)
defer func() {
if span != nil {
@@ -832,7 +986,9 @@ func (c *singleClient) Insert(ctx context.Context, in *payload.Insert_Request, o
return c.vc.Insert(ctx, in, opts...)
}
-func (c *singleClient) StreamInsert(ctx context.Context, opts ...grpc.CallOption) (res vald.Insert_StreamInsertClient, err error) {
+func (c *singleClient) StreamInsert(
+ ctx context.Context, opts ...grpc.CallOption,
+) (res vald.Insert_StreamInsertClient, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.StreamInsertRPCName), apiName+"/"+vald.StreamInsertRPCName)
defer func() {
if span != nil {
@@ -842,7 +998,9 @@ func (c *singleClient) StreamInsert(ctx context.Context, opts ...grpc.CallOption
return c.vc.StreamInsert(ctx, opts...)
}
-func (c *singleClient) MultiInsert(ctx context.Context, in *payload.Insert_MultiRequest, opts ...grpc.CallOption) (res *payload.Object_Locations, err error) {
+func (c *singleClient) MultiInsert(
+ ctx context.Context, in *payload.Insert_MultiRequest, opts ...grpc.CallOption,
+) (res *payload.Object_Locations, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.MultiInsertRPCName), apiName+"/"+vald.MultiInsertRPCName)
defer func() {
if span != nil {
@@ -852,7 +1010,9 @@ func (c *singleClient) MultiInsert(ctx context.Context, in *payload.Insert_Multi
return c.vc.MultiInsert(ctx, in, opts...)
}
-func (c *singleClient) Update(ctx context.Context, in *payload.Update_Request, opts ...grpc.CallOption) (res *payload.Object_Location, err error) {
+func (c *singleClient) Update(
+ ctx context.Context, in *payload.Update_Request, opts ...grpc.CallOption,
+) (res *payload.Object_Location, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.UpdateRPCName), apiName+"/"+vald.UpdateRPCName)
defer func() {
if span != nil {
@@ -862,7 +1022,9 @@ func (c *singleClient) Update(ctx context.Context, in *payload.Update_Request, o
return c.vc.Update(ctx, in, opts...)
}
-func (c *singleClient) StreamUpdate(ctx context.Context, opts ...grpc.CallOption) (res vald.Update_StreamUpdateClient, err error) {
+func (c *singleClient) StreamUpdate(
+ ctx context.Context, opts ...grpc.CallOption,
+) (res vald.Update_StreamUpdateClient, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.StreamUpdateRPCName), apiName+"/"+vald.StreamUpdateRPCName)
defer func() {
if span != nil {
@@ -872,7 +1034,9 @@ func (c *singleClient) StreamUpdate(ctx context.Context, opts ...grpc.CallOption
return c.vc.StreamUpdate(ctx, opts...)
}
-func (c *singleClient) MultiUpdate(ctx context.Context, in *payload.Update_MultiRequest, opts ...grpc.CallOption) (res *payload.Object_Locations, err error) {
+func (c *singleClient) MultiUpdate(
+ ctx context.Context, in *payload.Update_MultiRequest, opts ...grpc.CallOption,
+) (res *payload.Object_Locations, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.MultiUpdateRPCName), apiName+"/"+vald.MultiUpdateRPCName)
defer func() {
if span != nil {
@@ -882,7 +1046,9 @@ func (c *singleClient) MultiUpdate(ctx context.Context, in *payload.Update_Multi
return c.vc.MultiUpdate(ctx, in, opts...)
}
-func (c *singleClient) Upsert(ctx context.Context, in *payload.Upsert_Request, opts ...grpc.CallOption) (res *payload.Object_Location, err error) {
+func (c *singleClient) Upsert(
+ ctx context.Context, in *payload.Upsert_Request, opts ...grpc.CallOption,
+) (res *payload.Object_Location, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.UpsertRPCName), apiName+"/"+vald.UpsertRPCName)
defer func() {
if span != nil {
@@ -892,7 +1058,9 @@ func (c *singleClient) Upsert(ctx context.Context, in *payload.Upsert_Request, o
return c.vc.Upsert(ctx, in, opts...)
}
-func (c *singleClient) StreamUpsert(ctx context.Context, opts ...grpc.CallOption) (res vald.Upsert_StreamUpsertClient, err error) {
+func (c *singleClient) StreamUpsert(
+ ctx context.Context, opts ...grpc.CallOption,
+) (res vald.Upsert_StreamUpsertClient, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.StreamUpsertRPCName), apiName+"/"+vald.StreamUpsertRPCName)
defer func() {
if span != nil {
@@ -902,7 +1070,9 @@ func (c *singleClient) StreamUpsert(ctx context.Context, opts ...grpc.CallOption
return c.vc.StreamUpsert(ctx, opts...)
}
-func (c *singleClient) MultiUpsert(ctx context.Context, in *payload.Upsert_MultiRequest, opts ...grpc.CallOption) (res *payload.Object_Locations, err error) {
+func (c *singleClient) MultiUpsert(
+ ctx context.Context, in *payload.Upsert_MultiRequest, opts ...grpc.CallOption,
+) (res *payload.Object_Locations, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.MultiUpsertRPCName), apiName+"/"+vald.MultiUpsertRPCName)
defer func() {
if span != nil {
@@ -912,7 +1082,9 @@ func (c *singleClient) MultiUpsert(ctx context.Context, in *payload.Upsert_Multi
return c.vc.MultiUpsert(ctx, in, opts...)
}
-func (c *singleClient) Remove(ctx context.Context, in *payload.Remove_Request, opts ...grpc.CallOption) (res *payload.Object_Location, err error) {
+func (c *singleClient) Remove(
+ ctx context.Context, in *payload.Remove_Request, opts ...grpc.CallOption,
+) (res *payload.Object_Location, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.RemoveRPCName), apiName+"/"+vald.RemoveRPCName)
defer func() {
if span != nil {
@@ -922,7 +1094,9 @@ func (c *singleClient) Remove(ctx context.Context, in *payload.Remove_Request, o
return c.vc.Remove(ctx, in, opts...)
}
-func (c *singleClient) StreamRemove(ctx context.Context, opts ...grpc.CallOption) (res vald.Remove_StreamRemoveClient, err error) {
+func (c *singleClient) StreamRemove(
+ ctx context.Context, opts ...grpc.CallOption,
+) (res vald.Remove_StreamRemoveClient, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.StreamRemoveRPCName), apiName+"/"+vald.StreamRemoveRPCName)
defer func() {
if span != nil {
@@ -932,7 +1106,9 @@ func (c *singleClient) StreamRemove(ctx context.Context, opts ...grpc.CallOption
return c.vc.StreamRemove(ctx, opts...)
}
-func (c *singleClient) MultiRemove(ctx context.Context, in *payload.Remove_MultiRequest, opts ...grpc.CallOption) (res *payload.Object_Locations, err error) {
+func (c *singleClient) MultiRemove(
+ ctx context.Context, in *payload.Remove_MultiRequest, opts ...grpc.CallOption,
+) (res *payload.Object_Locations, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.MultiRemoveRPCName), apiName+"/"+vald.MultiRemoveRPCName)
defer func() {
if span != nil {
@@ -942,7 +1118,9 @@ func (c *singleClient) MultiRemove(ctx context.Context, in *payload.Remove_Multi
return c.vc.MultiRemove(ctx, in, opts...)
}
-func (c *singleClient) Flush(ctx context.Context, in *payload.Flush_Request, opts ...grpc.CallOption) (res *payload.Info_Index_Count, err error) {
+func (c *singleClient) Flush(
+ ctx context.Context, in *payload.Flush_Request, opts ...grpc.CallOption,
+) (res *payload.Info_Index_Count, err error) {
ctx, span := trace.StartSpan(ctx, apiName+"/singleClient.Flush")
defer func() {
if span != nil {
@@ -952,7 +1130,9 @@ func (c *singleClient) Flush(ctx context.Context, in *payload.Flush_Request, opt
return c.vc.Flush(ctx, in, opts...)
}
-func (c *singleClient) RemoveByTimestamp(ctx context.Context, in *payload.Remove_TimestampRequest, opts ...grpc.CallOption) (res *payload.Object_Locations, err error) {
+func (c *singleClient) RemoveByTimestamp(
+ ctx context.Context, in *payload.Remove_TimestampRequest, opts ...grpc.CallOption,
+) (res *payload.Object_Locations, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.RemoveByTimestampRPCName), apiName+"/"+vald.RemoveByTimestampRPCName)
defer func() {
if span != nil {
@@ -962,7 +1142,9 @@ func (c *singleClient) RemoveByTimestamp(ctx context.Context, in *payload.Remove
return c.vc.RemoveByTimestamp(ctx, in, opts...)
}
-func (c *singleClient) GetObject(ctx context.Context, in *payload.Object_VectorRequest, opts ...grpc.CallOption) (res *payload.Object_Vector, err error) {
+func (c *singleClient) GetObject(
+ ctx context.Context, in *payload.Object_VectorRequest, opts ...grpc.CallOption,
+) (res *payload.Object_Vector, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.GetObjectRPCName), apiName+"/"+vald.GetObjectRPCName)
defer func() {
if span != nil {
@@ -972,7 +1154,9 @@ func (c *singleClient) GetObject(ctx context.Context, in *payload.Object_VectorR
return c.vc.GetObject(ctx, in, opts...)
}
-func (c *singleClient) StreamGetObject(ctx context.Context, opts ...grpc.CallOption) (res vald.Object_StreamGetObjectClient, err error) {
+func (c *singleClient) StreamGetObject(
+ ctx context.Context, opts ...grpc.CallOption,
+) (res vald.Object_StreamGetObjectClient, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.StreamGetObjectRPCName), apiName+"/"+vald.StreamGetObjectRPCName)
defer func() {
if span != nil {
@@ -982,7 +1166,9 @@ func (c *singleClient) StreamGetObject(ctx context.Context, opts ...grpc.CallOpt
return c.vc.StreamGetObject(ctx, opts...)
}
-func (c *singleClient) StreamListObject(ctx context.Context, in *payload.Object_List_Request, opts ...grpc.CallOption) (res vald.Object_StreamListObjectClient, err error) {
+func (c *singleClient) StreamListObject(
+ ctx context.Context, in *payload.Object_List_Request, opts ...grpc.CallOption,
+) (res vald.Object_StreamListObjectClient, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.StreamListObjectRPCName), apiName+"/"+vald.StreamListObjectRPCName)
defer func() {
if span != nil {
@@ -991,3 +1177,39 @@ func (c *singleClient) StreamListObject(ctx context.Context, in *payload.Object_
}()
return c.vc.StreamListObject(ctx, in, opts...)
}
+
+func (c *singleClient) IndexInfo(
+ ctx context.Context, in *payload.Empty, opts ...grpc.CallOption,
+) (res *payload.Info_Index_Count, err error) {
+ ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.IndexInfoRPCName), apiName+"/"+vald.IndexInfoRPCName)
+ defer func() {
+ if span != nil {
+ span.End()
+ }
+ }()
+ return c.vc.IndexInfo(ctx, in, opts...)
+}
+
+func (c *singleClient) IndexDetail(
+ ctx context.Context, in *payload.Empty, opts ...grpc.CallOption,
+) (res *payload.Info_Index_Detail, err error) {
+ ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.IndexDetailRPCName), apiName+"/"+vald.IndexDetailRPCName)
+ defer func() {
+ if span != nil {
+ span.End()
+ }
+ }()
+ return c.vc.IndexDetail(ctx, in, opts...)
+}
+
+func (c *singleClient) GetTimestamp(
+ ctx context.Context, in *payload.Object_TimestampRequest, opts ...grpc.CallOption,
+) (res *payload.Object_Timestamp, err error) {
+ ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.GetTimestampRPCName), apiName+"/"+vald.GetTimestampRPCName)
+ defer func() {
+ if span != nil {
+ span.End()
+ }
+ }()
+ return c.vc.GetTimestamp(ctx, in, opts...)
+}
diff --git a/internal/compress/gob/gob.go b/internal/compress/gob/gob.go
index 0c8338acb8..cfaff13839 100644
--- a/internal/compress/gob/gob.go
+++ b/internal/compress/gob/gob.go
@@ -21,12 +21,12 @@ import (
// Encoder represents an interface for Encoder of gob.
type Encoder interface {
- Encode(e interface{}) error
+ Encode(e any) error
}
// Decoder represents an interface for Decoder of gob.
type Decoder interface {
- Decode(e interface{}) error
+ Decode(e any) error
}
// Transcoder is an interface to create Encoder and Decoder implementation.
diff --git a/internal/compress/gob/gob_mock.go b/internal/compress/gob/gob_mock.go
index af769c0e96..c37f4ff8ac 100644
--- a/internal/compress/gob/gob_mock.go
+++ b/internal/compress/gob/gob_mock.go
@@ -17,21 +17,21 @@ import "github.com/vdaas/vald/internal/io"
// MockEncoder represents mock struct of Encoder.
type MockEncoder struct {
- EncodeFunc func(e interface{}) error
+ EncodeFunc func(e any) error
}
// Encode calls EncodeFunc.
-func (m *MockEncoder) Encode(e interface{}) error {
+func (m *MockEncoder) Encode(e any) error {
return m.EncodeFunc(e)
}
// MockDecoder represents mock struct of Decoder.
type MockDecoder struct {
- DecodeFunc func(e interface{}) error
+ DecodeFunc func(e any) error
}
// Decode calls DecodeFunc.
-func (m *MockDecoder) Decode(e interface{}) error {
+func (m *MockDecoder) Decode(e any) error {
return m.DecodeFunc(e)
}
diff --git a/internal/compress/gob_test.go b/internal/compress/gob_test.go
index fecc3dd151..68545c880f 100644
--- a/internal/compress/gob_test.go
+++ b/internal/compress/gob_test.go
@@ -145,7 +145,7 @@ func Test_gobCompressor_CompressVector(t *testing.T) {
transcoder: &gob.MockTranscoder{
NewEncoderFunc: func(w io.Writer) gob.Encoder {
return &gob.MockEncoder{
- EncodeFunc: func(e interface{}) error {
+ EncodeFunc: func(e any) error {
_, _ = w.Write([]byte("vald"))
return nil
},
@@ -170,7 +170,7 @@ func Test_gobCompressor_CompressVector(t *testing.T) {
transcoder: &gob.MockTranscoder{
NewEncoderFunc: func(w io.Writer) gob.Encoder {
return &gob.MockEncoder{
- EncodeFunc: func(e interface{}) error {
+ EncodeFunc: func(e any) error {
return errors.New("err")
},
}
@@ -319,7 +319,7 @@ func Test_gobCompressor_DecompressVector(t *testing.T) {
transcoder: &gob.MockTranscoder{
NewDecoderFunc: func(io.Reader) gob.Decoder {
return &gob.MockDecoder{
- DecodeFunc: func(e interface{}) error {
+ DecodeFunc: func(e any) error {
reflect.ValueOf(e).Elem().Set(reflect.ValueOf(&[]float32{
1, 2, 3,
}).Elem())
@@ -346,7 +346,7 @@ func Test_gobCompressor_DecompressVector(t *testing.T) {
transcoder: &gob.MockTranscoder{
NewDecoderFunc: func(io.Reader) gob.Decoder {
return &gob.MockDecoder{
- DecodeFunc: func(interface{}) error {
+ DecodeFunc: func(any) error {
return errors.New("err")
},
}
@@ -588,7 +588,7 @@ func Test_gobReader_Read(t *testing.T) {
},
fields: fields{
decoder: &gob.MockDecoder{
- DecodeFunc: func(e interface{}) error {
+ DecodeFunc: func(e any) error {
reflect.ValueOf(e).Elem().Set(reflect.ValueOf([]byte("vald")))
return nil
},
@@ -607,7 +607,7 @@ func Test_gobReader_Read(t *testing.T) {
},
fields: fields{
decoder: &gob.MockDecoder{
- DecodeFunc: func(e interface{}) error {
+ DecodeFunc: func(e any) error {
return errors.New("err")
},
},
@@ -747,7 +747,7 @@ func Test_gobWriter_Write(t *testing.T) {
},
fields: fields{
encoder: &gob.MockEncoder{
- EncodeFunc: func(e interface{}) error {
+ EncodeFunc: func(e any) error {
reflect.ValueOf(e).Elem().Set(reflect.ValueOf([]byte("vald")))
return nil
},
@@ -766,7 +766,7 @@ func Test_gobWriter_Write(t *testing.T) {
},
fields: fields{
encoder: &gob.MockEncoder{
- EncodeFunc: func(e interface{}) error {
+ EncodeFunc: func(e any) error {
return errors.New("err")
},
},
diff --git a/internal/compress/lz4_option.go b/internal/compress/lz4_option.go
index f17c171814..7e170f4184 100644
--- a/internal/compress/lz4_option.go
+++ b/internal/compress/lz4_option.go
@@ -17,9 +17,7 @@
// Package compress provides compress functions
package compress
-import (
- "github.com/vdaas/vald/internal/errors"
-)
+import "github.com/vdaas/vald/internal/errors"
// LZ4Option represents the functional option for lz4Compressor.
type LZ4Option func(c *lz4Compressor) error
diff --git a/internal/compress/zstd_option.go b/internal/compress/zstd_option.go
index df60f7ac2c..a104dc8aa1 100644
--- a/internal/compress/zstd_option.go
+++ b/internal/compress/zstd_option.go
@@ -17,9 +17,7 @@
// Package compress provides compress functions
package compress
-import (
- "github.com/vdaas/vald/internal/compress/zstd"
-)
+import "github.com/vdaas/vald/internal/compress/zstd"
// ZstdOption represents the functional option for zstdCompressor.
type ZstdOption func(c *zstdCompressor) error
diff --git a/internal/config/config.go b/internal/config/config.go
index fba7c949a6..5fe764e5f2 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -63,7 +63,7 @@ func (c *GlobalConfig) Bind() *GlobalConfig {
}
// Read returns config struct or error when decoding the configuration file to actually *Config struct.
-func Read(path string, cfg interface{}) (err error) {
+func Read(path string, cfg any) (err error) {
f, err := file.Open(path, os.O_RDONLY, fs.ModePerm)
if err != nil {
return err
@@ -130,7 +130,7 @@ func checkPrefixAndSuffix(str, pref, suf string) bool {
}
// ToRawYaml writes the YAML encoding of v to the stream and returns the string written to stream.
-func ToRawYaml(data interface{}) string {
+func ToRawYaml(data any) string {
b, err := yaml.Marshal(data)
if err != nil {
log.Error(err)
diff --git a/internal/config/config_test.go b/internal/config/config_test.go
index 364ba64a69..1591b11099 100644
--- a/internal/config/config_test.go
+++ b/internal/config/config_test.go
@@ -273,21 +273,21 @@ func TestGlobalConfig_Bind(t *testing.T) {
func TestRead(t *testing.T) {
type args struct {
path string
- cfg interface{}
+ cfg any
}
type want struct {
- want interface{}
+ want any
err error
}
type test struct {
name string
args args
want want
- checkFunc func(want, interface{}, error) error
+ checkFunc func(want, any, error) error
beforeFunc func(*testing.T, args)
afterFunc func(*testing.T, args)
}
- defaultCheckFunc := func(w want, got interface{}, err error) error {
+ defaultCheckFunc := func(w want, got any, err error) error {
if !errors.Is(err, w.err) {
return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err)
}
@@ -405,7 +405,7 @@ func TestRead(t *testing.T) {
"logger": "glg"
}
}`
- cfg := make(map[string]interface{})
+ cfg := make(map[string]any)
return test{
name: "return nil when read json file successes and input data type is nested map",
@@ -436,10 +436,10 @@ func TestRead(t *testing.T) {
}
},
want: want{
- want: &map[string]interface{}{
+ want: &map[string]any{
"version": "v1.0.0",
"time_zone": "UTC",
- "logging": map[string]interface{}{
+ "logging": map[string]any{
"logger": "glg",
},
},
@@ -459,7 +459,7 @@ func TestRead(t *testing.T) {
"port": "3001"
}
]`
- cfg := make([]map[string]interface{}, 0)
+ cfg := make([]map[string]any, 0)
return test{
name: "return nil when read json file successes and input data type is map slice",
@@ -490,7 +490,7 @@ func TestRead(t *testing.T) {
}
},
want: want{
- want: &[]map[string]interface{}{
+ want: &[]map[string]any{
{
"addr": "0.0.0.0",
"port": "8080",
@@ -639,7 +639,7 @@ func TestRead(t *testing.T) {
func() test {
path := "read_config_test.yaml"
data := "version: v1.0.0\ntime_zone: UTC\nlogging:\n logger: glg"
- cfg := make(map[string]interface{})
+ cfg := make(map[string]any)
return test{
name: "return nil when read yaml file successes and input data type is nested map",
@@ -670,10 +670,10 @@ func TestRead(t *testing.T) {
}
},
want: want{
- want: &map[string]interface{}{
+ want: &map[string]any{
"version": "v1.0.0",
"time_zone": "UTC",
- "logging": map[string]interface{}{
+ "logging": map[string]any{
"logger": "glg",
},
},
@@ -684,7 +684,7 @@ func TestRead(t *testing.T) {
func() test {
path := "read_config_test.yaml"
data := "- \n addr: 0.0.0.0\n port: \"8080\"\n- \n addr: 0.0.0.0\n port: \"3001\""
- cfg := make([]map[string]interface{}, 0)
+ cfg := make([]map[string]any, 0)
return test{
name: "return nil when read yaml file successes and input data type is map slice",
@@ -715,7 +715,7 @@ func TestRead(t *testing.T) {
}
},
want: want{
- want: &[]map[string]interface{}{
+ want: &[]map[string]any{
{
"addr": "0.0.0.0",
"port": "8080",
@@ -1310,7 +1310,7 @@ func Test_checkPrefixAndSuffix(t *testing.T) {
func TestToRawYaml(t *testing.T) {
type args struct {
- data interface{}
+ data any
}
type want struct {
want string
@@ -1362,8 +1362,8 @@ func TestToRawYaml(t *testing.T) {
{
name: "return row string when data is a nested map type",
args: args{
- data: map[string]interface{}{
- "logging": map[string]interface{}{
+ data: map[string]any{
+ "logging": map[string]any{
"logger": "glg",
},
},
diff --git a/internal/config/meta.go b/internal/config/meta.go
index 2000cb4b25..5013302b2b 100644
--- a/internal/config/meta.go
+++ b/internal/config/meta.go
@@ -17,9 +17,7 @@
// Package config providers configuration type and load configuration logic
package config
-import (
- "github.com/vdaas/vald/internal/net"
-)
+import "github.com/vdaas/vald/internal/net"
// Meta represents the configurations for vald meta.
type Meta struct {
diff --git a/internal/conv/conv_bench_test.go b/internal/conv/conv_bench_test.go
index 49f8e7501d..a4365f6c2f 100644
--- a/internal/conv/conv_bench_test.go
+++ b/internal/conv/conv_bench_test.go
@@ -13,9 +13,7 @@
// limitations under the License.
package conv
-import (
- "testing"
-)
+import "testing"
func Benchmark_Btoa(b *testing.B) {
data := []byte(testData)
diff --git a/internal/core/algorithm/faiss/option.go b/internal/core/algorithm/faiss/option.go
index 650d28caaf..e7d7b757ed 100644
--- a/internal/core/algorithm/faiss/option.go
+++ b/internal/core/algorithm/faiss/option.go
@@ -17,6 +17,10 @@
// Package faiss provides implementation of Go API for https://github.com/facebookresearch/faiss
package faiss
+/*
+#cgo LDFLAGS: -lfaiss
+#include
+*/
import "C"
import (
diff --git a/internal/core/algorithm/ngt/ngt.go b/internal/core/algorithm/ngt/ngt.go
index 1f0b4d3fac..69d2a17ab2 100644
--- a/internal/core/algorithm/ngt/ngt.go
+++ b/internal/core/algorithm/ngt/ngt.go
@@ -304,7 +304,7 @@ func gen(isLoad bool, opts ...Option) (NGT, error) {
func (n *ngt) setup() error {
n.epool = sync.Pool{
- New: func() interface{} {
+ New: func() any {
return newNGTError()
},
}
@@ -404,7 +404,9 @@ func (n *ngt) loadObjectSpace() error {
}
// Search returns search result as []algorithm.SearchResult.
-func (n *ngt) Search(ctx context.Context, vec []float32, size int, epsilon, radius float32) (result []algorithm.SearchResult, err error) {
+func (n *ngt) Search(
+ ctx context.Context, vec []float32, size int, epsilon, radius float32,
+) (result []algorithm.SearchResult, err error) {
if len(vec) != int(n.dimension) {
return nil, errors.ErrIncompatibleDimensionSize(len(vec), int(n.dimension))
}
@@ -476,7 +478,9 @@ func (n *ngt) Search(ctx context.Context, vec []float32, size int, epsilon, radi
}
// Linear Search returns linear search result as []algorithm.SearchResult.
-func (n *ngt) LinearSearch(ctx context.Context, vec []float32, size int) (result []algorithm.SearchResult, err error) {
+func (n *ngt) LinearSearch(
+ ctx context.Context, vec []float32, size int,
+) (result []algorithm.SearchResult, err error) {
if len(vec) != int(n.dimension) {
return nil, errors.ErrIncompatibleDimensionSize(len(vec), int(n.dimension))
}
diff --git a/internal/db/kvs/pogreb/pogreb.go b/internal/db/kvs/pogreb/pogreb.go
index d2dc8854bd..26e7cc1da0 100644
--- a/internal/db/kvs/pogreb/pogreb.go
+++ b/internal/db/kvs/pogreb/pogreb.go
@@ -19,7 +19,6 @@ import (
"reflect"
"github.com/akrylysov/pogreb"
-
"github.com/vdaas/vald/internal/conv"
"github.com/vdaas/vald/internal/errors"
"github.com/vdaas/vald/internal/log"
diff --git a/internal/db/kvs/redis/hook.go b/internal/db/kvs/redis/hook.go
index 233bfa3504..1543da2e99 100644
--- a/internal/db/kvs/redis/hook.go
+++ b/internal/db/kvs/redis/hook.go
@@ -16,9 +16,7 @@
package redis
-import (
- redis "github.com/go-redis/redis/v8"
-)
+import redis "github.com/go-redis/redis/v8"
type (
Hook = redis.Hook
diff --git a/internal/db/kvs/redis/list.go b/internal/db/kvs/redis/list.go
index c78823b211..7c713a3e12 100644
--- a/internal/db/kvs/redis/list.go
+++ b/internal/db/kvs/redis/list.go
@@ -16,4 +16,4 @@
package redis
-type Lister interface{}
+type Lister any
diff --git a/internal/db/kvs/redis/set.go b/internal/db/kvs/redis/set.go
index 19b164418b..4ed9a3fb92 100644
--- a/internal/db/kvs/redis/set.go
+++ b/internal/db/kvs/redis/set.go
@@ -16,6 +16,4 @@
package redis
-type Setter interface { // Set(string, string) *redis.StringCmd
- // MSet(map[string]string) *redis.StringCmd
-}
+type Setter any
diff --git a/internal/db/nosql/cassandra/observer.go b/internal/db/nosql/cassandra/observer.go
index 46780e6a7c..0682f2f1d5 100644
--- a/internal/db/nosql/cassandra/observer.go
+++ b/internal/db/nosql/cassandra/observer.go
@@ -16,9 +16,7 @@
package cassandra
-import (
- "github.com/gocql/gocql"
-)
+import "github.com/gocql/gocql"
type (
QueryObserver = gocql.QueryObserver
diff --git a/internal/db/rdb/mysql/dbr/dbr.go b/internal/db/rdb/mysql/dbr/dbr.go
index bc65093794..e123403154 100644
--- a/internal/db/rdb/mysql/dbr/dbr.go
+++ b/internal/db/rdb/mysql/dbr/dbr.go
@@ -16,14 +16,12 @@
package dbr
-import (
- dbr "github.com/gocraft/dbr/v2"
-)
+import dbr "github.com/gocraft/dbr/v2"
// DBR repreesnts the interface to create connection to MySQL.
type DBR interface {
Open(driver, dsn string, log EventReceiver) (Connection, error)
- Eq(col string, val interface{}) Builder
+ Eq(col string, val any) Builder
}
type (
@@ -57,6 +55,6 @@ func (*db) Open(driver, dsn string, log EventReceiver) (Connection, error) {
}
// Eq returns the built SQL statement made from col name and the value.
-func (*db) Eq(col string, val interface{}) Builder {
+func (*db) Eq(col string, val any) Builder {
return dbr.Eq(col, val)
}
diff --git a/internal/db/rdb/mysql/dbr/dbr_mock.go b/internal/db/rdb/mysql/dbr/dbr_mock.go
index 636b9fb64d..2cad19ccc3 100644
--- a/internal/db/rdb/mysql/dbr/dbr_mock.go
+++ b/internal/db/rdb/mysql/dbr/dbr_mock.go
@@ -24,14 +24,14 @@ import (
type MockDBR struct {
OpenFunc func(driver, dsn string, log EventReceiver) (Connection, error)
- EqFunc func(col string, val interface{}) Builder
+ EqFunc func(col string, val any) Builder
}
func (d *MockDBR) Open(driver, dsn string, log EventReceiver) (Connection, error) {
return d.OpenFunc(driver, dsn, log)
}
-func (d *MockDBR) Eq(col string, val interface{}) Builder {
+func (d *MockDBR) Eq(col string, val any) Builder {
return d.EqFunc(col, val)
}
@@ -62,7 +62,7 @@ type MockTx struct {
CommitFunc func() error
RollbackFunc func() error
RollbackUnlessCommittedFunc func()
- InsertBySqlFunc func(query string, value ...interface{}) InsertStmt
+ InsertBySqlFunc func(query string, value ...any) InsertStmt
InsertIntoFunc func(table string) InsertStmt
SelectFunc func(column ...string) SelectStmt
DeleteFromFunc func(table string) DeleteStmt
@@ -80,7 +80,7 @@ func (t *MockTx) RollbackUnlessCommitted() {
t.RollbackUnlessCommittedFunc()
}
-func (t *MockTx) InsertBySql(query string, value ...interface{}) InsertStmt {
+func (t *MockTx) InsertBySql(query string, value ...any) InsertStmt {
return t.InsertBySqlFunc(query, value...)
}
@@ -120,17 +120,17 @@ func (c *MockConn) SetMaxOpenConns(n int) {
}
type MockSelect struct {
- FromFunc func(table interface{}) SelectStmt
- WhereFunc func(query interface{}, value ...interface{}) SelectStmt
+ FromFunc func(table any) SelectStmt
+ WhereFunc func(query any, value ...any) SelectStmt
LimitFunc func(n uint64) SelectStmt
- LoadContextFunc func(ctx context.Context, value interface{}) (int, error)
+ LoadContextFunc func(ctx context.Context, value any) (int, error)
}
-func (s *MockSelect) From(table interface{}) SelectStmt {
+func (s *MockSelect) From(table any) SelectStmt {
return s.FromFunc(table)
}
-func (s *MockSelect) Where(query interface{}, value ...interface{}) SelectStmt {
+func (s *MockSelect) Where(query any, value ...any) SelectStmt {
return s.WhereFunc(query, value...)
}
@@ -138,14 +138,14 @@ func (s *MockSelect) Limit(n uint64) SelectStmt {
return s.LimitFunc(n)
}
-func (s *MockSelect) LoadContext(ctx context.Context, value interface{}) (int, error) {
+func (s *MockSelect) LoadContext(ctx context.Context, value any) (int, error) {
return s.LoadContextFunc(ctx, value)
}
type MockInsert struct {
ColumnsFunc func(column ...string) InsertStmt
ExecContextFunc func(ctx context.Context) (sql.Result, error)
- RecordFunc func(structValue interface{}) InsertStmt
+ RecordFunc func(structValue any) InsertStmt
}
func (s *MockInsert) Columns(column ...string) InsertStmt {
@@ -156,19 +156,19 @@ func (s *MockInsert) ExecContext(ctx context.Context) (sql.Result, error) {
return s.ExecContextFunc(ctx)
}
-func (s *MockInsert) Record(structValue interface{}) InsertStmt {
+func (s *MockInsert) Record(structValue any) InsertStmt {
return s.RecordFunc(structValue)
}
type MockDelete struct {
ExecContextFunc func(ctx context.Context) (sql.Result, error)
- WhereFunc func(query interface{}, value ...interface{}) DeleteStmt
+ WhereFunc func(query any, value ...any) DeleteStmt
}
func (s *MockDelete) ExecContext(ctx context.Context) (sql.Result, error) {
return s.ExecContextFunc(ctx)
}
-func (s *MockDelete) Where(query interface{}, value ...interface{}) DeleteStmt {
+func (s *MockDelete) Where(query any, value ...any) DeleteStmt {
return s.WhereFunc(query, value...)
}
diff --git a/internal/db/rdb/mysql/dbr/delete.go b/internal/db/rdb/mysql/dbr/delete.go
index f04e470029..fc7307be83 100644
--- a/internal/db/rdb/mysql/dbr/delete.go
+++ b/internal/db/rdb/mysql/dbr/delete.go
@@ -26,7 +26,7 @@ import (
// DeleteStmt represents the interface to execute delete data.
type DeleteStmt interface {
ExecContext(ctx context.Context) (sql.Result, error)
- Where(query interface{}, value ...interface{}) DeleteStmt
+ Where(query any, value ...any) DeleteStmt
}
type deleteStmt struct {
@@ -39,7 +39,7 @@ func (stmt *deleteStmt) ExecContext(ctx context.Context) (sql.Result, error) {
}
// Where adds a where condition.
-func (stmt *deleteStmt) Where(query interface{}, value ...interface{}) DeleteStmt {
+func (stmt *deleteStmt) Where(query any, value ...any) DeleteStmt {
stmt.DeleteStmt = stmt.DeleteStmt.Where(query, value...)
return stmt
}
diff --git a/internal/db/rdb/mysql/dbr/insert.go b/internal/db/rdb/mysql/dbr/insert.go
index 5f60464b6c..8d96e916c8 100644
--- a/internal/db/rdb/mysql/dbr/insert.go
+++ b/internal/db/rdb/mysql/dbr/insert.go
@@ -27,7 +27,7 @@ import (
type InsertStmt interface {
Columns(column ...string) InsertStmt
ExecContext(ctx context.Context) (sql.Result, error)
- Record(structValue interface{}) InsertStmt
+ Record(structValue any) InsertStmt
}
type insertStmt struct {
@@ -46,7 +46,7 @@ func (stmt *insertStmt) ExecContext(ctx context.Context) (sql.Result, error) {
}
// Record adds a tuple for columns from a struct.
-func (stmt *insertStmt) Record(structValue interface{}) InsertStmt {
+func (stmt *insertStmt) Record(structValue any) InsertStmt {
stmt.InsertStmt = stmt.InsertStmt.Record(structValue)
return stmt
}
diff --git a/internal/db/rdb/mysql/dbr/select.go b/internal/db/rdb/mysql/dbr/select.go
index 01e9370352..56b0cd1d16 100644
--- a/internal/db/rdb/mysql/dbr/select.go
+++ b/internal/db/rdb/mysql/dbr/select.go
@@ -24,10 +24,10 @@ import (
// SelectStmt represents the interface to get data from database.
type SelectStmt interface {
- From(table interface{}) SelectStmt
- Where(query interface{}, value ...interface{}) SelectStmt
+ From(table any) SelectStmt
+ Where(query any, value ...any) SelectStmt
Limit(n uint64) SelectStmt
- LoadContext(ctx context.Context, value interface{}) (int, error)
+ LoadContext(ctx context.Context, value any) (int, error)
}
type selectStmt struct {
@@ -35,13 +35,13 @@ type selectStmt struct {
}
// From specifies table to select from.
-func (stmt *selectStmt) From(table interface{}) SelectStmt {
+func (stmt *selectStmt) From(table any) SelectStmt {
stmt.SelectStmt = stmt.SelectStmt.From(table)
return stmt
}
// Where adds a where condition.
-func (stmt *selectStmt) Where(query interface{}, value ...interface{}) SelectStmt {
+func (stmt *selectStmt) Where(query any, value ...any) SelectStmt {
stmt.SelectStmt = stmt.SelectStmt.Where(query, value...)
return stmt
}
@@ -53,6 +53,6 @@ func (stmt *selectStmt) Limit(n uint64) SelectStmt {
}
// LoadContext gets the result of select.
-func (stmt *selectStmt) LoadContext(ctx context.Context, value interface{}) (int, error) {
+func (stmt *selectStmt) LoadContext(ctx context.Context, value any) (int, error) {
return stmt.SelectStmt.LoadContext(ctx, value)
}
diff --git a/internal/db/rdb/mysql/dbr/tx.go b/internal/db/rdb/mysql/dbr/tx.go
index 5c88971ac0..ce5dc2d02d 100644
--- a/internal/db/rdb/mysql/dbr/tx.go
+++ b/internal/db/rdb/mysql/dbr/tx.go
@@ -16,16 +16,14 @@
package dbr
-import (
- dbr "github.com/gocraft/dbr/v2"
-)
+import dbr "github.com/gocraft/dbr/v2"
// Tx represents the interface to handle transaction.
type Tx interface {
Commit() error
Rollback() error
RollbackUnlessCommitted()
- InsertBySql(query string, value ...interface{}) InsertStmt
+ InsertBySql(query string, value ...any) InsertStmt
InsertInto(table string) InsertStmt
Select(column ...string) SelectStmt
DeleteFrom(table string) DeleteStmt
@@ -51,7 +49,7 @@ func (t *tx) RollbackUnlessCommitted() {
}
// InsertBySql creates an InsertStmt from raw query.
-func (t *tx) InsertBySql(query string, value ...interface{}) InsertStmt {
+func (t *tx) InsertBySql(query string, value ...any) InsertStmt {
return &insertStmt{
t.Tx.InsertBySql(query, value...),
}
diff --git a/internal/db/rdb/mysql/mysql_test.go b/internal/db/rdb/mysql/mysql_test.go
index 94d7463355..d0de5b6d7c 100644
--- a/internal/db/rdb/mysql/mysql_test.go
+++ b/internal/db/rdb/mysql/mysql_test.go
@@ -799,16 +799,16 @@ func Test_mySQLClient_GetVector(t *testing.T) {
session: &dbr.MockSession{
SelectFunc: func(column ...string) dbr.SelectStmt {
m := new(dbr.MockSelect)
- m.FromFunc = func(table interface{}) dbr.SelectStmt {
+ m.FromFunc = func(table any) dbr.SelectStmt {
return m
}
- m.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ m.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return m
}
m.LimitFunc = func(n uint64) dbr.SelectStmt {
return m
}
- m.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ m.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
return 0, err
}
return m
@@ -819,7 +819,7 @@ func Test_mySQLClient_GetVector(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -841,16 +841,16 @@ func Test_mySQLClient_GetVector(t *testing.T) {
session: &dbr.MockSession{
SelectFunc: func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
var d *data
if reflect.TypeOf(value) == reflect.TypeOf(&d) {
return 1, nil
@@ -865,7 +865,7 @@ func Test_mySQLClient_GetVector(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -892,16 +892,16 @@ func Test_mySQLClient_GetVector(t *testing.T) {
session: &dbr.MockSession{
SelectFunc: func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
var mv *data
var pp []podIP
if reflect.TypeOf(value) == reflect.TypeOf(&mv) {
@@ -921,7 +921,7 @@ func Test_mySQLClient_GetVector(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -954,16 +954,16 @@ func Test_mySQLClient_GetVector(t *testing.T) {
session: &dbr.MockSession{
SelectFunc: func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
var mv *data
var pp []podIP
if reflect.TypeOf(value) == reflect.TypeOf(&mv) {
@@ -985,7 +985,7 @@ func Test_mySQLClient_GetVector(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -1112,16 +1112,16 @@ func Test_mySQLClient_GetIPs(t *testing.T) {
session: &dbr.MockSession{
SelectFunc: func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
var id int64
if reflect.TypeOf(value) == reflect.TypeOf(&id) {
return 0, err
@@ -1136,7 +1136,7 @@ func Test_mySQLClient_GetIPs(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -1158,16 +1158,16 @@ func Test_mySQLClient_GetIPs(t *testing.T) {
session: &dbr.MockSession{
SelectFunc: func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
var id int64
if reflect.TypeOf(value) == reflect.TypeOf(&id) {
return 0, nil
@@ -1182,7 +1182,7 @@ func Test_mySQLClient_GetIPs(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -1215,16 +1215,16 @@ func Test_mySQLClient_GetIPs(t *testing.T) {
session: &dbr.MockSession{
SelectFunc: func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
var id int64
var pp []podIP
if reflect.TypeOf(value) == reflect.TypeOf(&id) {
@@ -1244,7 +1244,7 @@ func Test_mySQLClient_GetIPs(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -1280,16 +1280,16 @@ func Test_mySQLClient_GetIPs(t *testing.T) {
session: &dbr.MockSession{
SelectFunc: func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
var id int64
var pp []podIP
if reflect.TypeOf(value) == reflect.TypeOf(&id) {
@@ -1311,7 +1311,7 @@ func Test_mySQLClient_GetIPs(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -1560,7 +1560,7 @@ func Test_mySQLClient_SetVector(t *testing.T) {
return nil
}
tx.RollbackUnlessCommittedFunc = func() {}
- tx.InsertBySqlFunc = func(query string, value ...interface{}) dbr.InsertStmt {
+ tx.InsertBySqlFunc = func(query string, value ...any) dbr.InsertStmt {
return &dbr.MockInsert{
ExecContextFunc: func(ctx context.Context) (sql.Result, error) {
return nil, err
@@ -1598,7 +1598,7 @@ func Test_mySQLClient_SetVector(t *testing.T) {
return nil
}
tx.RollbackUnlessCommittedFunc = func() {}
- tx.InsertBySqlFunc = func(query string, value ...interface{}) dbr.InsertStmt {
+ tx.InsertBySqlFunc = func(query string, value ...any) dbr.InsertStmt {
return &dbr.MockInsert{
ExecContextFunc: func(ctx context.Context) (sql.Result, error) {
return nil, nil
@@ -1607,16 +1607,16 @@ func Test_mySQLClient_SetVector(t *testing.T) {
}
tx.SelectFunc = func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
return 0, err
}
return s
@@ -1629,7 +1629,7 @@ func Test_mySQLClient_SetVector(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -1656,7 +1656,7 @@ func Test_mySQLClient_SetVector(t *testing.T) {
return nil
}
tx.RollbackUnlessCommittedFunc = func() {}
- tx.InsertBySqlFunc = func(query string, value ...interface{}) dbr.InsertStmt {
+ tx.InsertBySqlFunc = func(query string, value ...any) dbr.InsertStmt {
return &dbr.MockInsert{
ExecContextFunc: func(ctx context.Context) (sql.Result, error) {
return nil, nil
@@ -1665,16 +1665,16 @@ func Test_mySQLClient_SetVector(t *testing.T) {
}
tx.SelectFunc = func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
var id int64
if reflect.TypeOf(value) == reflect.TypeOf(&id) {
id = int64(len(m.podIPs))
@@ -1693,7 +1693,7 @@ func Test_mySQLClient_SetVector(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -1727,7 +1727,7 @@ func Test_mySQLClient_SetVector(t *testing.T) {
return nil
}
tx.RollbackUnlessCommittedFunc = func() {}
- tx.InsertBySqlFunc = func(query string, value ...interface{}) dbr.InsertStmt {
+ tx.InsertBySqlFunc = func(query string, value ...any) dbr.InsertStmt {
return &dbr.MockInsert{
ExecContextFunc: func(ctx context.Context) (sql.Result, error) {
return nil, nil
@@ -1736,16 +1736,16 @@ func Test_mySQLClient_SetVector(t *testing.T) {
}
tx.SelectFunc = func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
var id int64
if reflect.TypeOf(value) == reflect.TypeOf(&id) {
id = int64(len(m.podIPs))
@@ -1761,7 +1761,7 @@ func Test_mySQLClient_SetVector(t *testing.T) {
s.ExecContextFunc = func(ctx context.Context) (sql.Result, error) {
return nil, err
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.DeleteStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.DeleteStmt {
return s
}
return s
@@ -1775,7 +1775,7 @@ func Test_mySQLClient_SetVector(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -1809,7 +1809,7 @@ func Test_mySQLClient_SetVector(t *testing.T) {
return nil
}
tx.RollbackUnlessCommittedFunc = func() {}
- tx.InsertBySqlFunc = func(query string, value ...interface{}) dbr.InsertStmt {
+ tx.InsertBySqlFunc = func(query string, value ...any) dbr.InsertStmt {
return &dbr.MockInsert{
ExecContextFunc: func(ctx context.Context) (sql.Result, error) {
return nil, nil
@@ -1824,23 +1824,23 @@ func Test_mySQLClient_SetVector(t *testing.T) {
s.ExecContextFunc = func(ctx context.Context) (sql.Result, error) {
return nil, err
}
- s.RecordFunc = func(structValue interface{}) dbr.InsertStmt {
+ s.RecordFunc = func(structValue any) dbr.InsertStmt {
return s
}
return s
}
tx.SelectFunc = func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
var id int64
if reflect.TypeOf(value) == reflect.TypeOf(&id) {
id = int64(len(m.podIPs))
@@ -1856,7 +1856,7 @@ func Test_mySQLClient_SetVector(t *testing.T) {
s.ExecContextFunc = func(ctx context.Context) (sql.Result, error) {
return nil, nil
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.DeleteStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.DeleteStmt {
return s
}
return s
@@ -1870,7 +1870,7 @@ func Test_mySQLClient_SetVector(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -1907,7 +1907,7 @@ func Test_mySQLClient_SetVector(t *testing.T) {
return nil
}
tx.RollbackUnlessCommittedFunc = func() {}
- tx.InsertBySqlFunc = func(query string, value ...interface{}) dbr.InsertStmt {
+ tx.InsertBySqlFunc = func(query string, value ...any) dbr.InsertStmt {
return &dbr.MockInsert{
ExecContextFunc: func(ctx context.Context) (sql.Result, error) {
return nil, nil
@@ -1922,23 +1922,23 @@ func Test_mySQLClient_SetVector(t *testing.T) {
s.ExecContextFunc = func(ctx context.Context) (sql.Result, error) {
return nil, nil
}
- s.RecordFunc = func(structValue interface{}) dbr.InsertStmt {
+ s.RecordFunc = func(structValue any) dbr.InsertStmt {
return s
}
return s
}
tx.SelectFunc = func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
var id int64
if reflect.TypeOf(value) == reflect.TypeOf(&id) {
id = int64(len(m.podIPs))
@@ -1954,7 +1954,7 @@ func Test_mySQLClient_SetVector(t *testing.T) {
s.ExecContextFunc = func(ctx context.Context) (sql.Result, error) {
return nil, nil
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.DeleteStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.DeleteStmt {
return s
}
return s
@@ -1968,7 +1968,7 @@ func Test_mySQLClient_SetVector(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -2004,7 +2004,7 @@ func Test_mySQLClient_SetVector(t *testing.T) {
return nil
}
tx.RollbackUnlessCommittedFunc = func() {}
- tx.InsertBySqlFunc = func(query string, value ...interface{}) dbr.InsertStmt {
+ tx.InsertBySqlFunc = func(query string, value ...any) dbr.InsertStmt {
return &dbr.MockInsert{
ExecContextFunc: func(ctx context.Context) (sql.Result, error) {
return nil, nil
@@ -2019,23 +2019,23 @@ func Test_mySQLClient_SetVector(t *testing.T) {
s.ExecContextFunc = func(ctx context.Context) (sql.Result, error) {
return nil, nil
}
- s.RecordFunc = func(structValue interface{}) dbr.InsertStmt {
+ s.RecordFunc = func(structValue any) dbr.InsertStmt {
return s
}
return s
}
tx.SelectFunc = func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
var id int64
if reflect.TypeOf(value) == reflect.TypeOf(&id) {
id = int64(len(m.podIPs))
@@ -2051,7 +2051,7 @@ func Test_mySQLClient_SetVector(t *testing.T) {
s.ExecContextFunc = func(ctx context.Context) (sql.Result, error) {
return nil, nil
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.DeleteStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.DeleteStmt {
return s
}
return s
@@ -2065,7 +2065,7 @@ func Test_mySQLClient_SetVector(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -2245,7 +2245,7 @@ func Test_mySQLClient_SetVectors(t *testing.T) {
return nil
}
tx.RollbackUnlessCommittedFunc = func() {}
- tx.InsertBySqlFunc = func(query string, value ...interface{}) dbr.InsertStmt {
+ tx.InsertBySqlFunc = func(query string, value ...any) dbr.InsertStmt {
return &dbr.MockInsert{
ExecContextFunc: func(ctx context.Context) (sql.Result, error) {
return nil, err
@@ -2285,7 +2285,7 @@ func Test_mySQLClient_SetVectors(t *testing.T) {
return nil
}
tx.RollbackUnlessCommittedFunc = func() {}
- tx.InsertBySqlFunc = func(query string, value ...interface{}) dbr.InsertStmt {
+ tx.InsertBySqlFunc = func(query string, value ...any) dbr.InsertStmt {
return &dbr.MockInsert{
ExecContextFunc: func(ctx context.Context) (sql.Result, error) {
return nil, err
@@ -2294,16 +2294,16 @@ func Test_mySQLClient_SetVectors(t *testing.T) {
}
tx.SelectFunc = func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
return 0, err
}
return s
@@ -2316,7 +2316,7 @@ func Test_mySQLClient_SetVectors(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -2345,7 +2345,7 @@ func Test_mySQLClient_SetVectors(t *testing.T) {
return nil
}
tx.RollbackUnlessCommittedFunc = func() {}
- tx.InsertBySqlFunc = func(query string, value ...interface{}) dbr.InsertStmt {
+ tx.InsertBySqlFunc = func(query string, value ...any) dbr.InsertStmt {
return &dbr.MockInsert{
ExecContextFunc: func(ctx context.Context) (sql.Result, error) {
return nil, nil
@@ -2354,16 +2354,16 @@ func Test_mySQLClient_SetVectors(t *testing.T) {
}
tx.SelectFunc = func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
var id int64
if reflect.TypeOf(value) == reflect.TypeOf(&id) {
id = int64(len(m[0].GetIPs()))
@@ -2382,7 +2382,7 @@ func Test_mySQLClient_SetVectors(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -2419,7 +2419,7 @@ func Test_mySQLClient_SetVectors(t *testing.T) {
return nil
}
tx.RollbackUnlessCommittedFunc = func() {}
- tx.InsertBySqlFunc = func(query string, value ...interface{}) dbr.InsertStmt {
+ tx.InsertBySqlFunc = func(query string, value ...any) dbr.InsertStmt {
return &dbr.MockInsert{
ExecContextFunc: func(ctx context.Context) (sql.Result, error) {
return nil, nil
@@ -2428,16 +2428,16 @@ func Test_mySQLClient_SetVectors(t *testing.T) {
}
tx.SelectFunc = func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
var id int64
if reflect.TypeOf(value) == reflect.TypeOf(&id) {
id = int64(len(m[0].GetIPs()))
@@ -2453,7 +2453,7 @@ func Test_mySQLClient_SetVectors(t *testing.T) {
s.ExecContextFunc = func(ctx context.Context) (sql.Result, error) {
return nil, err
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.DeleteStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.DeleteStmt {
return s
}
return s
@@ -2467,7 +2467,7 @@ func Test_mySQLClient_SetVectors(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -2503,7 +2503,7 @@ func Test_mySQLClient_SetVectors(t *testing.T) {
return nil
}
tx.RollbackUnlessCommittedFunc = func() {}
- tx.InsertBySqlFunc = func(query string, value ...interface{}) dbr.InsertStmt {
+ tx.InsertBySqlFunc = func(query string, value ...any) dbr.InsertStmt {
return &dbr.MockInsert{
ExecContextFunc: func(ctx context.Context) (sql.Result, error) {
return nil, nil
@@ -2518,23 +2518,23 @@ func Test_mySQLClient_SetVectors(t *testing.T) {
s.ExecContextFunc = func(ctx context.Context) (sql.Result, error) {
return nil, err
}
- s.RecordFunc = func(structValue interface{}) dbr.InsertStmt {
+ s.RecordFunc = func(structValue any) dbr.InsertStmt {
return s
}
return s
}
tx.SelectFunc = func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
var id int64
if reflect.TypeOf(value) == reflect.TypeOf(&id) {
id = int64(len(m[0].GetIPs()))
@@ -2550,7 +2550,7 @@ func Test_mySQLClient_SetVectors(t *testing.T) {
s.ExecContextFunc = func(ctx context.Context) (sql.Result, error) {
return nil, nil
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.DeleteStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.DeleteStmt {
return s
}
return s
@@ -2564,7 +2564,7 @@ func Test_mySQLClient_SetVectors(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -2603,7 +2603,7 @@ func Test_mySQLClient_SetVectors(t *testing.T) {
return nil
}
tx.RollbackUnlessCommittedFunc = func() {}
- tx.InsertBySqlFunc = func(query string, value ...interface{}) dbr.InsertStmt {
+ tx.InsertBySqlFunc = func(query string, value ...any) dbr.InsertStmt {
return &dbr.MockInsert{
ExecContextFunc: func(ctx context.Context) (sql.Result, error) {
return nil, nil
@@ -2618,23 +2618,23 @@ func Test_mySQLClient_SetVectors(t *testing.T) {
s.ExecContextFunc = func(ctx context.Context) (sql.Result, error) {
return nil, nil
}
- s.RecordFunc = func(structValue interface{}) dbr.InsertStmt {
+ s.RecordFunc = func(structValue any) dbr.InsertStmt {
return s
}
return s
}
tx.SelectFunc = func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
var id int64
if reflect.TypeOf(value) == reflect.TypeOf(&id) {
id = int64(len(m[0].GetIPs()))
@@ -2650,7 +2650,7 @@ func Test_mySQLClient_SetVectors(t *testing.T) {
s.ExecContextFunc = func(ctx context.Context) (sql.Result, error) {
return nil, nil
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.DeleteStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.DeleteStmt {
return s
}
return s
@@ -2664,7 +2664,7 @@ func Test_mySQLClient_SetVectors(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -2702,7 +2702,7 @@ func Test_mySQLClient_SetVectors(t *testing.T) {
return nil
}
tx.RollbackUnlessCommittedFunc = func() {}
- tx.InsertBySqlFunc = func(query string, value ...interface{}) dbr.InsertStmt {
+ tx.InsertBySqlFunc = func(query string, value ...any) dbr.InsertStmt {
return &dbr.MockInsert{
ExecContextFunc: func(ctx context.Context) (sql.Result, error) {
return nil, nil
@@ -2717,23 +2717,23 @@ func Test_mySQLClient_SetVectors(t *testing.T) {
s.ExecContextFunc = func(ctx context.Context) (sql.Result, error) {
return nil, nil
}
- s.RecordFunc = func(structValue interface{}) dbr.InsertStmt {
+ s.RecordFunc = func(structValue any) dbr.InsertStmt {
return s
}
return s
}
tx.SelectFunc = func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
var id int64
if reflect.TypeOf(value) == reflect.TypeOf(&id) {
id = int64(len(m[0].GetIPs()))
@@ -2749,7 +2749,7 @@ func Test_mySQLClient_SetVectors(t *testing.T) {
s.ExecContextFunc = func(ctx context.Context) (sql.Result, error) {
return nil, nil
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.DeleteStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.DeleteStmt {
return s
}
return s
@@ -2763,7 +2763,7 @@ func Test_mySQLClient_SetVectors(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -2847,16 +2847,16 @@ func Test_mySQLClient_DeleteVector(t *testing.T) {
RollbackUnlessCommittedFunc: func() {},
SelectFunc: func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
var id int64
if reflect.TypeOf(value) == reflect.TypeOf(&id) {
id := int64(1)
@@ -2873,7 +2873,7 @@ func Test_mySQLClient_DeleteVector(t *testing.T) {
s.ExecContextFunc = func(ctx context.Context) (sql.Result, error) {
return nil, nil
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.DeleteStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.DeleteStmt {
return s
}
return s
@@ -2886,7 +2886,7 @@ func Test_mySQLClient_DeleteVector(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -2911,16 +2911,16 @@ func Test_mySQLClient_DeleteVector(t *testing.T) {
RollbackUnlessCommittedFunc: func() {},
SelectFunc: func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
var id int64
if reflect.TypeOf(value) == reflect.TypeOf(&id) {
id := int64(1)
@@ -2937,7 +2937,7 @@ func Test_mySQLClient_DeleteVector(t *testing.T) {
s.ExecContextFunc = func(ctx context.Context) (sql.Result, error) {
return nil, nil
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.DeleteStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.DeleteStmt {
return s
}
return s
@@ -2950,7 +2950,7 @@ func Test_mySQLClient_DeleteVector(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -3061,16 +3061,16 @@ func Test_mySQLClient_DeleteVector(t *testing.T) {
RollbackUnlessCommittedFunc: func() {},
SelectFunc: func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
return 0, err
}
@@ -3084,7 +3084,7 @@ func Test_mySQLClient_DeleteVector(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -3113,16 +3113,16 @@ func Test_mySQLClient_DeleteVector(t *testing.T) {
RollbackUnlessCommittedFunc: func() {},
SelectFunc: func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
return 0, nil
}
@@ -3136,7 +3136,7 @@ func Test_mySQLClient_DeleteVector(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -3164,16 +3164,16 @@ func Test_mySQLClient_DeleteVector(t *testing.T) {
RollbackUnlessCommittedFunc: func() {},
SelectFunc: func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
var id int64
if reflect.TypeOf(value) == reflect.TypeOf(&id) {
id := int64(1)
@@ -3193,7 +3193,7 @@ func Test_mySQLClient_DeleteVector(t *testing.T) {
}
return nil, nil
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.DeleteStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.DeleteStmt {
return s
}
return s
@@ -3206,7 +3206,7 @@ func Test_mySQLClient_DeleteVector(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -3234,16 +3234,16 @@ func Test_mySQLClient_DeleteVector(t *testing.T) {
RollbackUnlessCommittedFunc: func() {},
SelectFunc: func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
var id int64
if reflect.TypeOf(value) == reflect.TypeOf(&id) {
id := int64(1)
@@ -3263,7 +3263,7 @@ func Test_mySQLClient_DeleteVector(t *testing.T) {
}
return nil, nil
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.DeleteStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.DeleteStmt {
return s
}
return s
@@ -3276,7 +3276,7 @@ func Test_mySQLClient_DeleteVector(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -3303,16 +3303,16 @@ func Test_mySQLClient_DeleteVector(t *testing.T) {
RollbackUnlessCommittedFunc: func() {},
SelectFunc: func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
var id int64
if reflect.TypeOf(value) == reflect.TypeOf(&id) {
id := int64(1)
@@ -3329,7 +3329,7 @@ func Test_mySQLClient_DeleteVector(t *testing.T) {
s.ExecContextFunc = func(ctx context.Context) (sql.Result, error) {
return nil, nil
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.DeleteStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.DeleteStmt {
return s
}
return s
@@ -3342,7 +3342,7 @@ func Test_mySQLClient_DeleteVector(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -3426,16 +3426,16 @@ func Test_mySQLClient_DeleteVectors(t *testing.T) {
RollbackUnlessCommittedFunc: func() {},
SelectFunc: func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
var id int64
if reflect.TypeOf(value) == reflect.TypeOf(&id) {
id := int64(1)
@@ -3452,7 +3452,7 @@ func Test_mySQLClient_DeleteVectors(t *testing.T) {
s.ExecContextFunc = func(ctx context.Context) (sql.Result, error) {
return nil, nil
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.DeleteStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.DeleteStmt {
return s
}
return s
@@ -3465,7 +3465,7 @@ func Test_mySQLClient_DeleteVectors(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -3493,16 +3493,16 @@ func Test_mySQLClient_DeleteVectors(t *testing.T) {
RollbackUnlessCommittedFunc: func() {},
SelectFunc: func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
var id int64
if reflect.TypeOf(value) == reflect.TypeOf(&id) {
id := int64(1)
@@ -3519,7 +3519,7 @@ func Test_mySQLClient_DeleteVectors(t *testing.T) {
s.ExecContextFunc = func(ctx context.Context) (sql.Result, error) {
return nil, nil
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.DeleteStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.DeleteStmt {
return s
}
return s
@@ -3532,7 +3532,7 @@ func Test_mySQLClient_DeleteVectors(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -3695,16 +3695,16 @@ func Test_mySQLClient_SetIPs(t *testing.T) {
RollbackUnlessCommittedFunc: func() {},
SelectFunc: func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
var id int64
if reflect.TypeOf(value) == reflect.TypeOf(&id) {
id = 1
@@ -3723,7 +3723,7 @@ func Test_mySQLClient_SetIPs(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -3754,16 +3754,16 @@ func Test_mySQLClient_SetIPs(t *testing.T) {
RollbackUnlessCommittedFunc: func() {},
SelectFunc: func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
var id int64
if reflect.TypeOf(value) == reflect.TypeOf(&id) {
reflect.ValueOf(value).Elem().Set(reflect.ValueOf(id))
@@ -3781,7 +3781,7 @@ func Test_mySQLClient_SetIPs(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -3819,23 +3819,23 @@ func Test_mySQLClient_SetIPs(t *testing.T) {
s.ExecContextFunc = func(ctx context.Context) (sql.Result, error) {
return nil, err
}
- s.RecordFunc = func(structValue interface{}) dbr.InsertStmt {
+ s.RecordFunc = func(structValue any) dbr.InsertStmt {
return s
}
return s
},
SelectFunc: func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
var id int64
if reflect.TypeOf(value) == reflect.TypeOf(&id) {
id = 1
@@ -3854,7 +3854,7 @@ func Test_mySQLClient_SetIPs(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -3891,23 +3891,23 @@ func Test_mySQLClient_SetIPs(t *testing.T) {
s.ExecContextFunc = func(ctx context.Context) (sql.Result, error) {
return nil, nil
}
- s.RecordFunc = func(structValue interface{}) dbr.InsertStmt {
+ s.RecordFunc = func(structValue any) dbr.InsertStmt {
return s
}
return s
},
SelectFunc: func(column ...string) dbr.SelectStmt {
s := new(dbr.MockSelect)
- s.FromFunc = func(table interface{}) dbr.SelectStmt {
+ s.FromFunc = func(table any) dbr.SelectStmt {
return s
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.SelectStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.SelectStmt {
return s
}
s.LimitFunc = func(n uint64) dbr.SelectStmt {
return s
}
- s.LoadContextFunc = func(ctx context.Context, value interface{}) (int, error) {
+ s.LoadContextFunc = func(ctx context.Context, value any) (int, error) {
var id int64
if reflect.TypeOf(value) == reflect.TypeOf(&id) {
id = 1
@@ -3926,7 +3926,7 @@ func Test_mySQLClient_SetIPs(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -4087,7 +4087,7 @@ func Test_mySQLClient_RemoveIPs(t *testing.T) {
s.ExecContextFunc = func(ctx context.Context) (sql.Result, error) {
return nil, err
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.DeleteStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.DeleteStmt {
return s
}
return s
@@ -4100,7 +4100,7 @@ func Test_mySQLClient_RemoveIPs(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
@@ -4133,7 +4133,7 @@ func Test_mySQLClient_RemoveIPs(t *testing.T) {
s.ExecContextFunc = func(ctx context.Context) (sql.Result, error) {
return nil, nil
}
- s.WhereFunc = func(query interface{}, value ...interface{}) dbr.DeleteStmt {
+ s.WhereFunc = func(query any, value ...any) dbr.DeleteStmt {
return s
}
return s
@@ -4146,7 +4146,7 @@ func Test_mySQLClient_RemoveIPs(t *testing.T) {
return
}(),
dbr: &dbr.MockDBR{
- EqFunc: func(col string, val interface{}) dbr.Builder {
+ EqFunc: func(col string, val any) dbr.Builder {
return dbr.New().Eq(col, val)
},
},
diff --git a/internal/db/storage/blob/cloudstorage/option.go b/internal/db/storage/blob/cloudstorage/option.go
index 575265a41c..28ccb2a056 100644
--- a/internal/db/storage/blob/cloudstorage/option.go
+++ b/internal/db/storage/blob/cloudstorage/option.go
@@ -50,7 +50,7 @@ func WithURLOpener(uo *gcsblob.URLOpener) Option {
}
// WithBeforeRead returns Option that sets c.readerOpts.BeforeRead.
-func WithBeforeRead(fn func(asFunc func(interface{}) bool) error) Option {
+func WithBeforeRead(fn func(asFunc func(any) bool) error) Option {
return func(c *client) error {
if fn != nil {
if c.readerOpts == nil {
@@ -167,7 +167,7 @@ func WithWriteMetadata(meta map[string]string) Option {
}
// WithBeforeWrite returns Option that sets c.writeOpts.BeforeWrite.
-func WithBeforeWrite(f func(asFunc func(interface{}) bool) error) Option {
+func WithBeforeWrite(f func(asFunc func(any) bool) error) Option {
return func(c *client) error {
if f != nil {
if c.writerOpts == nil {
diff --git a/internal/db/storage/blob/cloudstorage/option_test.go b/internal/db/storage/blob/cloudstorage/option_test.go
index b7653f0908..b3e75bc3c8 100644
--- a/internal/db/storage/blob/cloudstorage/option_test.go
+++ b/internal/db/storage/blob/cloudstorage/option_test.go
@@ -189,7 +189,7 @@ package cloudstorage
//
// func TestWithBeforeRead(t *testing.T) {
// type args struct {
-// fn func(asFunc func(interface{}) bool) error
+// fn func(asFunc func(any) bool) error
// }
// type want struct {
// want Option
@@ -963,7 +963,7 @@ package cloudstorage
//
// func TestWithBeforeWrite(t *testing.T) {
// type args struct {
-// f func(asFunc func(interface{}) bool) error
+// f func(asFunc func(any) bool) error
// }
// type want struct {
// want Option
diff --git a/internal/db/storage/blob/cloudstorage/urlopener/option.go b/internal/db/storage/blob/cloudstorage/urlopener/option.go
index e962a50fff..f58bd2d822 100644
--- a/internal/db/storage/blob/cloudstorage/urlopener/option.go
+++ b/internal/db/storage/blob/cloudstorage/urlopener/option.go
@@ -13,9 +13,7 @@
// limitations under the License.
package urlopener
-import (
- "net/http"
-)
+import "net/http"
type Option func(*urlOpener) error
diff --git a/internal/db/storage/blob/s3/reader/io/io.go b/internal/db/storage/blob/s3/reader/io/io.go
index c4acc67e73..b03da989a3 100644
--- a/internal/db/storage/blob/s3/reader/io/io.go
+++ b/internal/db/storage/blob/s3/reader/io/io.go
@@ -38,6 +38,8 @@ func (*ctxio) NewReaderWithContext(ctx context.Context, r io.Reader) (io.Reader,
}
// NewReadCloserWithContext calls io.NewReadCloserWithContext.
-func (*ctxio) NewReadCloserWithContext(ctx context.Context, r io.ReadCloser) (io.ReadCloser, error) {
+func (*ctxio) NewReadCloserWithContext(
+ ctx context.Context, r io.ReadCloser,
+) (io.ReadCloser, error) {
return io.NewReadCloserWithContext(ctx, r)
}
diff --git a/internal/db/storage/blob/s3/reader/reader.go b/internal/db/storage/blob/s3/reader/reader.go
index 937d890c5d..3c994a8455 100644
--- a/internal/db/storage/blob/s3/reader/reader.go
+++ b/internal/db/storage/blob/s3/reader/reader.go
@@ -140,11 +140,13 @@ func (r *reader) Open(ctx context.Context, key string) (err error) {
return nil
}
-func (r *reader) getObjectWithBackoff(ctx context.Context, key string, offset, length int64) (res io.Reader, err error) {
+func (r *reader) getObjectWithBackoff(
+ ctx context.Context, key string, offset, length int64,
+) (res io.Reader, err error) {
if !r.backoffEnabled || r.bo == nil {
return r.getObject(ctx, key, offset, length)
}
- _, err = r.bo.Do(ctx, func(ctx context.Context) (interface{}, bool, error) {
+ _, err = r.bo.Do(ctx, func(ctx context.Context) (any, bool, error) {
res, err = r.getObject(ctx, key, offset, length)
if err != nil {
if errors.As(err, &errBlobNoSuchBucket) ||
@@ -162,7 +164,9 @@ func (r *reader) getObjectWithBackoff(ctx context.Context, key string, offset, l
return res, nil
}
-func (r *reader) getObject(ctx context.Context, key string, offset, length int64) (io.Reader, error) {
+func (r *reader) getObject(
+ ctx context.Context, key string, offset, length int64,
+) (io.Reader, error) {
rng := aws.String("bytes=" + strconv.FormatInt(offset, 10) + "-" + strconv.FormatInt(offset+length-1, 10))
log.Debugf("reading %s", *rng)
resp, err := r.service.GetObjectWithContext(
diff --git a/internal/db/storage/blob/s3/reader/reader_mock.go b/internal/db/storage/blob/s3/reader/reader_mock.go
index 6a3bebdaf5..cc4af2bae3 100644
--- a/internal/db/storage/blob/s3/reader/reader_mock.go
+++ b/internal/db/storage/blob/s3/reader/reader_mock.go
@@ -35,7 +35,9 @@ type MockS3API struct {
}
// GetObjectWithContext calls GetObjectWithContextFunc.
-func (m *MockS3API) GetObjectWithContext(ctx aws.Context, in *s3.GetObjectInput, opts ...request.Option) (*s3.GetObjectOutput, error) {
+func (m *MockS3API) GetObjectWithContext(
+ ctx aws.Context, in *s3.GetObjectInput, opts ...request.Option,
+) (*s3.GetObjectOutput, error) {
return m.GetObjectWithContextFunc(ctx, in, opts...)
}
@@ -51,7 +53,9 @@ func (m *MockIO) NewReaderWithContext(ctx context.Context, r io.Reader) (io.Read
}
// NewReadCloserWithContext calls NewReadCloserWithContextFunc.
-func (m *MockIO) NewReadCloserWithContext(ctx context.Context, r io.ReadCloser) (io.ReadCloser, error) {
+func (m *MockIO) NewReadCloserWithContext(
+ ctx context.Context, r io.ReadCloser,
+) (io.ReadCloser, error) {
return m.NewReadCloserWithContextFunc(ctx, r)
}
diff --git a/internal/db/storage/blob/s3/sdk/s3/s3.go b/internal/db/storage/blob/s3/sdk/s3/s3.go
index 01ca3e5153..fea202bcf6 100644
--- a/internal/db/storage/blob/s3/sdk/s3/s3.go
+++ b/internal/db/storage/blob/s3/sdk/s3/s3.go
@@ -13,9 +13,7 @@
// limitations under the License.
package s3
-import (
- "github.com/aws/aws-sdk-go/service/s3"
-)
+import "github.com/aws/aws-sdk-go/service/s3"
type (
// S3 is type alias for s3.S3.
diff --git a/internal/db/storage/blob/s3/writer/writer_mock.go b/internal/db/storage/blob/s3/writer/writer_mock.go
index 5b20fc9062..b6b61f6749 100644
--- a/internal/db/storage/blob/s3/writer/writer_mock.go
+++ b/internal/db/storage/blob/s3/writer/writer_mock.go
@@ -49,7 +49,9 @@ type MockS3Manager struct {
}
// NewUploaderWithClient calls NewUNewUploaderWithClientFunc.
-func (m *MockS3Manager) NewUploaderWithClient(svc s3iface.S3API, opts ...func(*s3manager.Uploader)) s3manager.UploadClient {
+func (m *MockS3Manager) NewUploaderWithClient(
+ svc s3iface.S3API, opts ...func(*s3manager.Uploader),
+) s3manager.UploadClient {
return m.NewUploaderWithClientFunc(svc, opts...)
}
@@ -57,7 +59,9 @@ type MockUploadClient struct {
UploadWithContextFunc func(aws.Context, *s3manager.UploadInput, ...func(*s3manager.Uploader)) (*s3manager.UploadOutput, error)
}
-func (m *MockUploadClient) UploadWithContext(ctx aws.Context, input *s3manager.UploadInput, opts ...func(*s3manager.Uploader)) (*s3manager.UploadOutput, error) {
+func (m *MockUploadClient) UploadWithContext(
+ ctx aws.Context, input *s3manager.UploadInput, opts ...func(*s3manager.Uploader),
+) (*s3manager.UploadOutput, error) {
return m.UploadWithContextFunc(ctx, input, opts...)
}
diff --git a/internal/encoding/json/json.go b/internal/encoding/json/json.go
index c38a658205..030469eb3a 100644
--- a/internal/encoding/json/json.go
+++ b/internal/encoding/json/json.go
@@ -21,22 +21,22 @@ import (
"github.com/vdaas/vald/internal/io"
)
-func Encode(w io.Writer, data interface{}) (err error) {
+func Encode(w io.Writer, data any) (err error) {
return json.NewEncoder(w).Encode(data)
}
-func Decode(r io.Reader, data interface{}) (err error) {
+func Decode(r io.Reader, data any) (err error) {
return json.NewDecoder(r).Decode(data)
}
-func Unmarshal(data []byte, i interface{}) error {
+func Unmarshal(data []byte, i any) error {
return json.Unmarshal(data, i)
}
-func Marshal(data interface{}) ([]byte, error) {
+func Marshal(data any) ([]byte, error) {
return json.Marshal(data)
}
-func MarshalIndent(data interface{}, pref, ind string) ([]byte, error) {
+func MarshalIndent(data any, pref, ind string) ([]byte, error) {
return json.MarshalIndent(data, pref, ind)
}
diff --git a/internal/encoding/json/json_test.go b/internal/encoding/json/json_test.go
index ea2b258268..cb0ecd46ac 100644
--- a/internal/encoding/json/json_test.go
+++ b/internal/encoding/json/json_test.go
@@ -26,7 +26,7 @@ import (
func TestEncode(t *testing.T) {
type args struct {
w io.Writer
- data interface{}
+ data any
}
type test struct {
@@ -165,7 +165,7 @@ func TestDecode(t *testing.T) {
func TestMarshalIndent(t *testing.T) {
type args struct {
- data interface{}
+ data any
pref string
ind string
}
@@ -234,7 +234,7 @@ func TestMarshalIndent(t *testing.T) {
// func TestUnmarshal(t *testing.T) {
// type args struct {
// data []byte
-// i interface{}
+// i any
// }
// type want struct {
// err error
@@ -322,7 +322,7 @@ func TestMarshalIndent(t *testing.T) {
//
// func TestMarshal(t *testing.T) {
// type args struct {
-// data interface{}
+// data any
// }
// type want struct {
// want []byte
diff --git a/internal/errors/agent_test.go b/internal/errors/agent_test.go
index 3feb17129f..360045f847 100644
--- a/internal/errors/agent_test.go
+++ b/internal/errors/agent_test.go
@@ -17,9 +17,7 @@
// Package errors
package errors
-import (
- "testing"
-)
+import "testing"
func TestErrObjectNotFound(t *testing.T) {
type args struct {
diff --git a/internal/errors/benchmark.go b/internal/errors/benchmark.go
index e73f888009..191ee102f6 100644
--- a/internal/errors/benchmark.go
+++ b/internal/errors/benchmark.go
@@ -31,7 +31,7 @@ var (
}
// ErrMismatchBenchmarkAtomics represents a function to generate an error that mismatch each atomic.Pointer stored corresponding to benchmark tasks.
- ErrMismatchBenchmarkAtomics = func(job, benchjob, benchscenario interface{}) error {
+ ErrMismatchBenchmarkAtomics = func(job, benchjob, benchscenario any) error {
return Errorf("mismatch atomics: job=%v\tbenchjob=%v\tbenchscenario=%v", job, benchjob, benchscenario)
}
)
diff --git a/internal/errors/errors.go b/internal/errors/errors.go
index e7165313e1..4cb67e7c68 100644
--- a/internal/errors/errors.go
+++ b/internal/errors/errors.go
@@ -61,7 +61,7 @@ var (
}
// ErrInvalidTypeConversion represents a function to generate an error that type conversion fails due to an invalid input type.
- ErrInvalidTypeConversion = func(i interface{}, tgt interface{}) error {
+ ErrInvalidTypeConversion = func(i any, tgt any) error {
return Errorf("invalid type conversion %v to %v", reflect.TypeOf(i), reflect.TypeOf(tgt))
}
@@ -108,7 +108,7 @@ var (
// Wrapf represents a function to generate an error that is used by input error, format, and args.
// When all of the input is nil, it will return a new error based on format and args even these are nil.
// When the input error is not nil, it will return an error based on the input error.
- Wrapf = func(err error, format string, args ...interface{}) error {
+ Wrapf = func(err error, format string, args ...any) error {
if err != nil {
if format != "" && len(args) != 0 {
return Wrap(err, fmt.Sprintf(format, args...))
@@ -129,7 +129,7 @@ var (
// Errorf represents a function to generate an error based on format and args.
// When format and args do not satisfy the condition, it will return nil.
- Errorf = func(format string, args ...interface{}) error {
+ Errorf = func(format string, args ...any) error {
const delim = " "
if format == "" && len(args) == 0 {
return nil
@@ -304,7 +304,7 @@ type joinError struct {
}
var sbPool = sync.Pool{
- New: func() interface{} {
+ New: func() any {
return new(strings.Builder)
},
}
diff --git a/internal/errors/errors_benchmark_test.go b/internal/errors/errors_benchmark_test.go
index 92ef365b93..c5af30b93e 100644
--- a/internal/errors/errors_benchmark_test.go
+++ b/internal/errors/errors_benchmark_test.go
@@ -51,9 +51,7 @@ func TestMain(m *testing.M) {
bigData = nil
}
-func benchmark(b *testing.B, data map[string]error,
- join func(err1, err2 error) error,
-) {
+func benchmark(b *testing.B, data map[string]error, join func(err1, err2 error) error) {
b.Helper()
b.SetParallelism(parallelism)
b.ReportAllocs()
diff --git a/internal/errors/errors_test.go b/internal/errors/errors_test.go
index 170ff2a5a0..e4e8e67008 100644
--- a/internal/errors/errors_test.go
+++ b/internal/errors/errors_test.go
@@ -192,7 +192,7 @@ func TestErrOptionFailed(t *testing.T) {
args: args{
err: New("option failed error"),
ref: func() reflect.Value {
- var i interface{} = fmt.Println
+ var i any = fmt.Println
return reflect.ValueOf(i)
}(),
},
@@ -402,8 +402,8 @@ func TestErrBackoffTimeout(t *testing.T) {
func TestErrInvalidTypeConversion(t *testing.T) {
type args struct {
- i interface{}
- tgt interface{}
+ i any
+ tgt any
}
type want struct {
want error
@@ -532,7 +532,7 @@ func TestErrLoggingRetry(t *testing.T) {
args: args{
err: New("logging retry"),
ref: func() reflect.Value {
- var i interface{} = fmt.Println
+ var i any = fmt.Println
return reflect.ValueOf(i)
}(),
},
@@ -634,7 +634,7 @@ func TestErrLoggingFailed(t *testing.T) {
args: args{
err: New("logging retry"),
ref: func() reflect.Value {
- var i interface{} = fmt.Println
+ var i any = fmt.Println
return reflect.ValueOf(i)
}(),
},
@@ -866,7 +866,7 @@ func TestWrapf(t *testing.T) {
type args struct {
err error
format string
- args []interface{}
+ args []any
}
type want struct {
want error
@@ -889,7 +889,7 @@ func TestWrapf(t *testing.T) {
func() test {
err := New("err: ")
format := "error is occurred: %v"
- val := []interface{}{
+ val := []any{
"timeout error",
}
wantErr := fmt.Errorf("%s: %w", fmt.Sprintf(format, val...), err)
@@ -908,7 +908,7 @@ func TestWrapf(t *testing.T) {
func() test {
err := New("err: ")
format := "error is occurred: %v : %v"
- val := []interface{}{
+ val := []any{
"invalid time_duration",
10,
}
@@ -927,7 +927,7 @@ func TestWrapf(t *testing.T) {
}(),
func() test {
err := New("err: ")
- val := []interface{}{
+ val := []any{
"invalid time_duration",
10,
}
@@ -973,7 +973,7 @@ func TestWrapf(t *testing.T) {
}(),
func() test {
format := "error is occurred: %v : %v"
- val := []interface{}{
+ val := []any{
"invalid time_duration",
10,
}
@@ -1010,7 +1010,7 @@ func TestWrapf(t *testing.T) {
}
}(),
func() test {
- val := []interface{}{
+ val := []any{
"invalid time_duration",
10,
}
@@ -1026,7 +1026,7 @@ func TestWrapf(t *testing.T) {
}
}(),
func() test {
- val := []interface{}{
+ val := []any{
map[string]int{"invalid time_duration": 10},
}
wantErr := fmt.Errorf("%v", val[0])
@@ -1198,7 +1198,7 @@ func TestUnwarp(t *testing.T) {
func TestErrorf(t *testing.T) {
type args struct {
format string
- args []interface{}
+ args []any
}
type want struct {
want error
@@ -1220,7 +1220,7 @@ func TestErrorf(t *testing.T) {
tests := []test{
func() test {
format := "error is occurred: %v"
- val := []interface{}{
+ val := []any{
"timeout error",
}
wantErr := fmt.Errorf(format, val...)
@@ -1237,7 +1237,7 @@ func TestErrorf(t *testing.T) {
}(),
func() test {
format := "error is occurred: %v : %v"
- val := []interface{}{
+ val := []any{
"invalid time_duration",
10,
}
@@ -1254,7 +1254,7 @@ func TestErrorf(t *testing.T) {
}
}(),
func() test {
- val := []interface{}{
+ val := []any{
"invalid time_duration",
10,
}
@@ -1270,7 +1270,7 @@ func TestErrorf(t *testing.T) {
}
}(),
func() test {
- val := []interface{}{
+ val := []any{
map[string]int{"invalid time_duration": 10},
}
wantErr := fmt.Errorf("%v", val[0])
@@ -1529,7 +1529,7 @@ func TestIs(t *testing.T) {
func TestAs(t *testing.T) {
type args struct {
err error
- target interface{}
+ target any
}
type want struct {
want bool
diff --git a/internal/errors/file_test.go b/internal/errors/file_test.go
index 6980689ca7..b2f13f9bff 100644
--- a/internal/errors/file_test.go
+++ b/internal/errors/file_test.go
@@ -13,9 +13,7 @@
// limitations under the License.
package errors
-import (
- "testing"
-)
+import "testing"
func TestErrWatchDirNotFound(t *testing.T) {
type want struct {
diff --git a/internal/errors/filter_test.go b/internal/errors/filter_test.go
index dd5a802ea5..e22c451398 100644
--- a/internal/errors/filter_test.go
+++ b/internal/errors/filter_test.go
@@ -17,9 +17,7 @@
// Package errors provides error types and function
package errors
-import (
- "testing"
-)
+import "testing"
func TestErrTargetFilterNotFound(t *testing.T) {
type args struct {
diff --git a/internal/errors/grpc.go b/internal/errors/grpc.go
index 296e978f7f..4df3243912 100644
--- a/internal/errors/grpc.go
+++ b/internal/errors/grpc.go
@@ -67,7 +67,7 @@ var (
}
// ErrInvalidProtoMessageType represents an error that the gRPC protocol buffers message type is invalid.
- ErrInvalidProtoMessageType = func(v interface{}) error {
+ ErrInvalidProtoMessageType = func(v any) error {
return Errorf("failed to marshal/unmarshal proto message, message type is %T (missing vtprotobuf/protobuf helpers)", v)
}
diff --git a/internal/errors/info_test.go b/internal/errors/info_test.go
index f79da1c52d..bc44be9f2b 100644
--- a/internal/errors/info_test.go
+++ b/internal/errors/info_test.go
@@ -17,9 +17,7 @@
// Package errors provides error types and function
package errors
-import (
- "testing"
-)
+import "testing"
func TestErrFailedToInitInfo(t *testing.T) {
type args struct {
diff --git a/internal/errors/option.go b/internal/errors/option.go
index 874e2c7525..8b3bda142b 100644
--- a/internal/errors/option.go
+++ b/internal/errors/option.go
@@ -20,7 +20,7 @@ type ErrInvalidOption struct {
}
// NewErrInvalidOption represents a function to generate a new error of ErrInvalidOption that invalid option.
-func NewErrInvalidOption(name string, val interface{}, errs ...error) error {
+func NewErrInvalidOption(name string, val any, errs ...error) error {
if len(errs) == 0 {
return &ErrInvalidOption{
err: Errorf("invalid option, name: %s, val: %v", name, val),
@@ -65,7 +65,7 @@ type ErrCriticalOption struct {
}
// NewErrCriticalOption represents a function to generate a new error of ErrCriticalOption that invalid option.
-func NewErrCriticalOption(name string, val interface{}, errs ...error) error {
+func NewErrCriticalOption(name string, val any, errs ...error) error {
if len(errs) == 0 {
return &ErrCriticalOption{
err: Errorf("invalid critical option, name: %s, val: %v", name, val),
diff --git a/internal/errors/option_test.go b/internal/errors/option_test.go
index 314ac7e933..8fba808dde 100644
--- a/internal/errors/option_test.go
+++ b/internal/errors/option_test.go
@@ -23,7 +23,7 @@ import (
func TestNewErrInvalidOption(t *testing.T) {
type args struct {
name string
- val interface{}
+ val any
errs []error
}
type want struct {
@@ -318,7 +318,7 @@ func TestNewErrCriticalOption(t *testing.T) {
type T = error
type args struct {
name string
- val interface{}
+ val any
errs []error
}
type want struct {
diff --git a/internal/errors/runtime.go b/internal/errors/runtime.go
index 337a86f3f7..01d3a1351d 100644
--- a/internal/errors/runtime.go
+++ b/internal/errors/runtime.go
@@ -21,7 +21,7 @@ import "runtime"
var (
// ErrPanicRecovered represents a function to generate an error that the panic recovered.
- ErrPanicRecovered = func(err error, rec interface{}) error {
+ ErrPanicRecovered = func(err error, rec any) error {
return Wrap(err, Errorf("panic recovered: %v", rec).Error())
}
diff --git a/internal/errors/runtime_test.go b/internal/errors/runtime_test.go
index 4c532d57c0..77ccce3167 100644
--- a/internal/errors/runtime_test.go
+++ b/internal/errors/runtime_test.go
@@ -28,7 +28,7 @@ import (
func TestErrPanicRecovered(t *testing.T) {
type args struct {
err error
- rec interface{}
+ rec any
}
type want struct {
want error
diff --git a/internal/errors/unit_test.go b/internal/errors/unit_test.go
index 0d4ceca89e..210800f347 100644
--- a/internal/errors/unit_test.go
+++ b/internal/errors/unit_test.go
@@ -13,9 +13,7 @@
// limitations under the License.
package errors
-import (
- "testing"
-)
+import "testing"
func TestErrParseUnitFailed(t *testing.T) {
type args struct {
diff --git a/internal/errors/vald_test.go b/internal/errors/vald_test.go
index 2089cc4d60..9801de5802 100644
--- a/internal/errors/vald_test.go
+++ b/internal/errors/vald_test.go
@@ -13,9 +13,7 @@
// limitations under the License.
package errors
-import (
- "testing"
-)
+import "testing"
func TestErrMetaDataAlreadyExists(t *testing.T) {
type args struct {
diff --git a/internal/file/file.go b/internal/file/file.go
index 6e97b2f7c8..238a3b0de6 100644
--- a/internal/file/file.go
+++ b/internal/file/file.go
@@ -259,19 +259,27 @@ func CopyFileWithPerm(ctx context.Context, src, dst string, perm fs.FileMode) (n
return n, nil
}
-func WriteFile(ctx context.Context, target string, r io.Reader, perm fs.FileMode) (n int64, err error) {
+func WriteFile(
+ ctx context.Context, target string, r io.Reader, perm fs.FileMode,
+) (n int64, err error) {
return writeFileWithContext(ctx, target, r, os.O_CREATE|os.O_WRONLY|os.O_SYNC, perm)
}
-func OverWriteFile(ctx context.Context, target string, r io.Reader, perm fs.FileMode) (n int64, err error) {
+func OverWriteFile(
+ ctx context.Context, target string, r io.Reader, perm fs.FileMode,
+) (n int64, err error) {
return writeFileWithContext(ctx, target, r, os.O_CREATE|os.O_TRUNC|os.O_WRONLY|os.O_SYNC, perm)
}
-func AppendFile(ctx context.Context, target string, r io.Reader, perm fs.FileMode) (n int64, err error) {
+func AppendFile(
+ ctx context.Context, target string, r io.Reader, perm fs.FileMode,
+) (n int64, err error) {
return writeFileWithContext(ctx, target, r, os.O_CREATE|os.O_APPEND|os.O_RDWR|os.O_SYNC, perm)
}
-func writeFileWithContext(ctx context.Context, target string, r io.Reader, flg int, perm fs.FileMode) (n int64, err error) {
+func writeFileWithContext(
+ ctx context.Context, target string, r io.Reader, flg int, perm fs.FileMode,
+) (n int64, err error) {
if len(target) == 0 || r == nil {
return 0, nil
}
@@ -479,7 +487,7 @@ func ListInDir(path string) ([]string, error) {
return files, nil
}
-// DeleteDir recursively deletes each file or directory based on the path specified as an argument
+// DeleteDir recursively deletes each file or directory based on the path specified as an argument.
func DeleteDir(ctx context.Context, path string) (err error) {
exists, _, err := ExistsWithDetail(path)
if err != nil {
diff --git a/internal/info/info.go b/internal/info/info.go
index f8c820701d..6f5f31e0f9 100644
--- a/internal/info/info.go
+++ b/internal/info/info.go
@@ -48,16 +48,20 @@ type info struct {
// Detail represents environment information of system and stacktrace information.
type Detail struct {
- Version string `json:"vald_version,omitempty" yaml:"vald_version,omitempty"`
- ServerName string `json:"server_name,omitempty" yaml:"server_name,omitempty"`
- GitCommit string `json:"git_commit,omitempty" yaml:"git_commit,omitempty"`
+ AlgorithmInfo string `json:"algorithm_info,omitempty" yaml:"algorithm_info,omitempty"`
BuildTime string `json:"build_time,omitempty" yaml:"build_time,omitempty"`
- GoVersion string `json:"go_version,omitempty" yaml:"go_version,omitempty"`
- GoOS string `json:"go_os,omitempty" yaml:"go_os,omitempty"`
+ CGOCall string `json:"cgo_call,omitempty" yaml:"cgo_call"`
+ CGOEnabled string `json:"cgo_enabled,omitempty" yaml:"cgo_enabled,omitempty"`
+ GitCommit string `json:"git_commit,omitempty" yaml:"git_commit,omitempty"`
GoArch string `json:"go_arch,omitempty" yaml:"go_arch,omitempty"`
+ GoMaxProcs string `json:"go_max_procs,omitempty" yaml:"go_max_procs,omitempty"`
+ GoOS string `json:"go_os,omitempty" yaml:"go_os,omitempty"`
GoRoot string `json:"go_root,omitempty" yaml:"go_root,omitempty"`
- CGOEnabled string `json:"cgo_enabled,omitempty" yaml:"cgo_enabled,omitempty"`
- AlgorithmInfo string `json:"algorithm_info,omitempty" yaml:"algorithm_info,omitempty"`
+ GoVersion string `json:"go_version,omitempty" yaml:"go_version,omitempty"`
+ GoroutineCount string `json:"goroutine_count,omitempty" yaml:"goroutine_count"`
+ RuntimeCPUCores string `json:"runtime_cpu_cores,omitempty" yaml:"runtime_cpu_cores,omitempty"`
+ ServerName string `json:"server_name,omitempty" yaml:"server_name,omitempty"`
+ Version string `json:"vald_version,omitempty" yaml:"vald_version,omitempty"`
BuildCPUInfoFlags []string `json:"build_cpu_info_flags,omitempty" yaml:"build_cpu_info_flags,omitempty"`
StackTrace []StackTrace `json:"stack_trace,omitempty" yaml:"stack_trace,omitempty"`
}
@@ -137,18 +141,19 @@ func Init(name string) {
func New(opts ...Option) (Info, error) {
i := &info{
detail: Detail{
- ServerName: "",
- Version: Version,
- GitCommit: GitCommit,
+ AlgorithmInfo: AlgorithmInfo,
+ BuildCPUInfoFlags: strings.Split(strings.TrimSpace(BuildCPUInfoFlags), " "),
BuildTime: BuildTime,
- GoVersion: GoVersion,
- GoOS: GoOS,
+ CGOEnabled: CGOEnabled,
+ GitCommit: GitCommit,
GoArch: GoArch,
+ GoOS: GoOS,
GoRoot: GoRoot,
- CGOEnabled: CGOEnabled,
- AlgorithmInfo: AlgorithmInfo,
- BuildCPUInfoFlags: strings.Split(strings.TrimSpace(BuildCPUInfoFlags), " "),
+ GoVersion: GoVersion,
+ RuntimeCPUCores: strconv.Itoa(runtime.NumCPU()),
+ ServerName: "",
StackTrace: nil,
+ Version: Version,
},
}
@@ -177,7 +182,7 @@ func New(opts ...Option) (Info, error) {
// String calls String method of global detail object.
func String() string {
if infoProvider == nil {
- return ""
+ Init(log.Bold("WARNING: uninitialized info provider"))
}
return infoProvider.String()
}
@@ -185,7 +190,7 @@ func String() string {
// Get calls Get method of global detail object.
func Get() Detail {
if infoProvider == nil {
- return Detail{}
+ Init(log.Bold("WARNING: uninitialized info provider"))
}
return infoProvider.Get()
}
@@ -255,6 +260,12 @@ func (d Detail) String() string {
if maxlen < l {
maxlen = l
}
+ switch tag {
+ case "cgo_call":
+ value = strconv.FormatInt(runtime.NumCgoCall(), 10)
+ case "goroutine_count":
+ value = strconv.Itoa(runtime.NumGoroutine())
+ }
info[tag] = value
}
@@ -370,6 +381,15 @@ func (i *info) prepare() {
if i.baseURL == "" {
i.baseURL = "https://" + valdRepo + "/tree/" + i.detail.GitCommit
}
+ if len(i.detail.GoMaxProcs) == 0 {
+ i.detail.GoMaxProcs = strconv.Itoa(runtime.GOMAXPROCS(-1))
+ }
+ if len(i.detail.CGOCall) == 0 {
+ i.detail.CGOCall = strconv.FormatInt(runtime.NumCgoCall(), 10)
+ }
+ if len(i.detail.GoroutineCount) == 0 {
+ i.detail.GoroutineCount = strconv.Itoa(runtime.NumGoroutine())
+ }
})
}
diff --git a/internal/info/info_bench_test.go b/internal/info/info_bench_test.go
index 1696235155..d91761c292 100644
--- a/internal/info/info_bench_test.go
+++ b/internal/info/info_bench_test.go
@@ -13,9 +13,7 @@
// limitations under the License.
package info
-import (
- "testing"
-)
+import "testing"
func BenchmarkString(b *testing.B) {
Init("benchmark")
diff --git a/internal/info/info_test.go b/internal/info/info_test.go
deleted file mode 100644
index 0d8e1e04b3..0000000000
--- a/internal/info/info_test.go
+++ /dev/null
@@ -1,1833 +0,0 @@
-//
-// Copyright (C) 2019-2024 vdaas.org vald team
-//
-// 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
-//
-// https://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 info provides build-time info
-package info
-
-import (
- "os"
- "reflect"
- "runtime"
- "testing"
-
- "github.com/vdaas/vald/internal/errors"
- "github.com/vdaas/vald/internal/log"
- "github.com/vdaas/vald/internal/log/logger"
- "github.com/vdaas/vald/internal/strings"
- "github.com/vdaas/vald/internal/sync"
- "github.com/vdaas/vald/internal/test/comparator"
- "github.com/vdaas/vald/internal/test/goleak"
-)
-
-// Goroutine leak is detected by `fastime`, but it should be ignored in the test because it is an external package.
-var goleakIgnoreOptions = []goleak.Option{
- goleak.IgnoreTopFunction("github.com/kpango/fastime.(*fastime).StartTimerD.func1"),
-}
-
-func TestMain(m *testing.M) {
- log.Init(log.WithLoggerType(logger.NOP.String()))
- os.Exit(m.Run())
-}
-
-func TestString(t *testing.T) {
- type want struct {
- want *Detail
- }
- type test struct {
- name string
- want want
- checkFunc func(want, string) error
- beforeFunc func(*testing.T)
- afterFunc func(*testing.T)
- }
- defaultCheckFunc := func(w want, got string) error {
- if got == w.want.String() {
- // check the position of "->"
- var oldIdx int
- for i, str := range strings.Split(strings.TrimPrefix(got, "\n"), "\n") {
- idx := strings.Index(str, "->")
- if i != 0 {
- if oldIdx != idx {
- return errors.Errorf("\tgot: \"%v\",\n\t\t\t\twant: \"%v\"", got, w.want)
- }
- }
- oldIdx = idx
- }
- return nil
- }
- return errors.Errorf("\tgot: \"%v\",\n\t\t\t\twant: \"%v\"", got, w.want)
- }
- tests := []test{
- {
- name: "return correct string with no stack trace initialized",
- beforeFunc: func(t *testing.T) {
- t.Helper()
- infoProvider, _ = New(WithServerName(""),
- WithRuntimeCaller(func(skip int) (pc uintptr, file string, line int, ok bool) {
- return uintptr(0), "", 0, false
- }))
- },
- afterFunc: func(t *testing.T) {
- t.Helper()
- once = sync.Once{}
- infoProvider = nil
- },
- want: want{
- want: &Detail{
- Version: "v0.0.1",
- ServerName: "",
- GitCommit: GitCommit,
- BuildTime: "",
- GoVersion: runtime.Version(),
- GoOS: runtime.GOOS,
- GoArch: runtime.GOARCH,
- GoRoot: runtime.GOROOT(),
- CGOEnabled: cgoUnknown,
- AlgorithmInfo: "",
- BuildCPUInfoFlags: nil,
- StackTrace: nil,
- },
- },
- },
- {
- name: "return correct string with no information initialized",
- beforeFunc: func(t *testing.T) {
- t.Helper()
- infoProvider = &info{
- rtCaller: func(skip int) (pc uintptr, file string, line int, ok bool) {
- return uintptr(0), "", 0, false
- },
- }
- },
- afterFunc: func(t *testing.T) {
- t.Helper()
- once = sync.Once{}
- infoProvider = nil
- },
- want: want{
- want: &Detail{
- Version: "",
- ServerName: "",
- GitCommit: GitCommit,
- BuildTime: "",
- GoVersion: runtime.Version(),
- GoOS: runtime.GOOS,
- GoArch: runtime.GOARCH,
- GoRoot: runtime.GOROOT(),
- CGOEnabled: cgoUnknown,
- AlgorithmInfo: "",
- BuildCPUInfoFlags: nil,
- StackTrace: nil,
- },
- },
- },
- }
-
- for _, tc := range tests {
- test := tc
- t.Run(test.name, func(tt *testing.T) {
- if test.afterFunc != nil {
- defer test.afterFunc(tt)
- }
- if test.beforeFunc != nil {
- test.beforeFunc(tt)
- }
- checkFunc := test.checkFunc
- if test.checkFunc == nil {
- checkFunc = defaultCheckFunc
- }
-
- got := String()
- if err := checkFunc(test.want, got); err != nil {
- tt.Errorf("error = %v", err)
- }
- })
- }
-}
-
-func TestGet(t *testing.T) {
- type want struct {
- want Detail
- }
- type test struct {
- name string
- want want
- checkFunc func(want, Detail) error
- beforeFunc func(*testing.T)
- afterFunc func(*testing.T)
- }
- defaultCheckFunc := func(w want, got Detail) error {
- if !reflect.DeepEqual(got, w.want) {
- return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want)
- }
- return nil
- }
- tests := []test{
- {
- name: "return detail with initialized runtime information",
- beforeFunc: func(t *testing.T) {
- t.Helper()
- infoProvider, _ = New(WithServerName(""), WithRuntimeCaller(func(skip int) (pc uintptr, file string, line int, ok bool) {
- return uintptr(0), "", 0, false
- }))
- },
- afterFunc: func(t *testing.T) {
- t.Helper()
- once = sync.Once{}
- infoProvider = nil
- },
- want: want{
- want: Detail{
- ServerName: "",
- Version: Version,
- BuildTime: "",
- GitCommit: GitCommit,
- GoVersion: runtime.Version(),
- GoOS: runtime.GOOS,
- GoArch: runtime.GOARCH,
- GoRoot: runtime.GOROOT(),
- CGOEnabled: cgoUnknown,
- AlgorithmInfo: "",
- BuildCPUInfoFlags: []string{""},
- StackTrace: make([]StackTrace, 0, 10),
- },
- },
- },
- }
-
- for _, tc := range tests {
- test := tc
- t.Run(test.name, func(tt *testing.T) {
- if test.beforeFunc != nil {
- test.beforeFunc(tt)
- }
- if test.afterFunc != nil {
- defer test.afterFunc(tt)
- }
- checkFunc := test.checkFunc
- if test.checkFunc == nil {
- checkFunc = defaultCheckFunc
- }
-
- got := Get()
- if err := checkFunc(test.want, got); err != nil {
- tt.Errorf("error = %v", err)
- }
- })
- }
-}
-
-func TestInit(t *testing.T) {
- type args struct {
- name string
- }
- type want struct {
- want Info
- }
- type test struct {
- name string
- args args
- want want
- checkFunc func(want, Info) error
- beforeFunc func(*testing.T, args)
- afterFunc func(*testing.T, args)
- }
- defaultCheckFunc := func(w want, got Info) error {
- opts := []comparator.Option{
- comparator.AllowUnexported(info{}),
- // skipcq: VET-V0008
- comparator.Comparer(func(x, y sync.Once) bool {
- // skipcq: VET-V0008
- return reflect.DeepEqual(x, y)
- }),
- comparator.Comparer(func(x, y func(skip int) (pc uintptr, file string, line int, ok bool)) bool {
- return reflect.ValueOf(x).Pointer() == reflect.ValueOf(y).Pointer()
- }),
- comparator.Comparer(func(x, y func(pc uintptr) *runtime.Func) bool {
- return reflect.ValueOf(x).Pointer() == reflect.ValueOf(y).Pointer()
- }),
- }
- if diff := comparator.Diff(w.want, got, opts...); len(diff) != 0 {
- return errors.Errorf("err: %s", diff)
- }
- return nil
- }
-
- gitCommit := GitCommit
- version := Version
- buildTime := BuildTime
- cgoEnabled := CGOEnabled
- ngtVersion := AlgorithmInfo
- buildCPUInfoFlags := BuildCPUInfoFlags
- tests := []test{
- {
- name: "set success when the server name is not empty",
- args: args{
- name: "gateway",
- },
- want: want{
- want: &info{
- baseURL: "https://github.com/vdaas/vald/tree/gitcommit",
- detail: Detail{
- GitCommit: "gitcommit",
- ServerName: "gateway",
- Version: "gitcommit",
- BuildTime: "1s",
- GoVersion: runtime.Version(),
- GoOS: runtime.GOOS,
- GoArch: runtime.GOARCH,
- GoRoot: runtime.GOROOT(),
- CGOEnabled: cgoTrue,
- AlgorithmInfo: "v1.11.6",
- BuildCPUInfoFlags: []string{
- "avx512f", "avx512dq",
- },
- StackTrace: nil,
- },
- rtCaller: runtime.Caller,
- rtFuncForPC: runtime.FuncForPC,
- prepOnce: func() (o sync.Once) {
- o.Do(func() {})
- return
- }(),
- },
- },
- beforeFunc: func(t *testing.T, _ args) {
- t.Helper()
- GitCommit = "gitcommit"
- Version = ""
- BuildTime = "1s"
- CGOEnabled = cgoTrue
- AlgorithmInfo = "v1.11.6"
- BuildCPUInfoFlags = "\t\tavx512f avx512dq\t"
- },
- afterFunc: func(t *testing.T, _ args) {
- t.Helper()
- once = sync.Once{}
- infoProvider = nil
-
- GitCommit = gitCommit
- Version = version
- BuildTime = buildTime
- CGOEnabled = cgoEnabled
- AlgorithmInfo = ngtVersion
- BuildCPUInfoFlags = buildCPUInfoFlags
- },
- },
- {
- name: "set success when the server name is an empty string",
- args: args{
- name: "",
- },
- want: want{
- want: &info{
- baseURL: "https://github.com/vdaas/vald/tree/gitcommit",
- detail: Detail{
- GitCommit: "gitcommit",
- ServerName: "",
- Version: "gitcommit",
- BuildTime: "1s",
- GoVersion: runtime.Version(),
- GoOS: runtime.GOOS,
- GoArch: runtime.GOARCH,
- GoRoot: runtime.GOROOT(),
- CGOEnabled: cgoTrue,
- AlgorithmInfo: "v1.11.6",
- BuildCPUInfoFlags: []string{
- "avx512f", "avx512dq",
- },
- StackTrace: nil,
- },
- rtCaller: runtime.Caller,
- rtFuncForPC: runtime.FuncForPC,
- prepOnce: func() (o sync.Once) {
- o.Do(func() {})
- return
- }(),
- },
- },
- beforeFunc: func(t *testing.T, _ args) {
- t.Helper()
- GitCommit = "gitcommit"
- Version = ""
- BuildTime = "1s"
- CGOEnabled = cgoTrue
- AlgorithmInfo = "v1.11.6"
- BuildCPUInfoFlags = "\t\tavx512f avx512dq\t"
- },
- afterFunc: func(t *testing.T, _ args) {
- t.Helper()
- once = sync.Once{}
- infoProvider = nil
-
- GitCommit = gitCommit
- Version = version
- BuildTime = buildTime
- CGOEnabled = cgoEnabled
- AlgorithmInfo = ngtVersion
- BuildCPUInfoFlags = buildCPUInfoFlags
- },
- },
- }
-
- for _, tc := range tests {
- test := tc
- t.Run(test.name, func(tt *testing.T) {
- if test.beforeFunc != nil {
- test.beforeFunc(tt, test.args)
- }
- if test.afterFunc != nil {
- defer test.afterFunc(tt, test.args)
- }
- checkFunc := test.checkFunc
- if test.checkFunc == nil {
- checkFunc = defaultCheckFunc
- }
-
- Init(test.args.name)
- if err := checkFunc(test.want, infoProvider); err != nil {
- tt.Errorf("error = %v", err)
- }
- })
- }
-}
-
-func TestNew(t *testing.T) {
- type args struct {
- opts []Option
- }
- type want struct {
- want Info
- err error
- }
- type test struct {
- name string
- args args
- want want
- checkFunc func(want, Info, error) error
- beforeFunc func(args)
- afterFunc func(*testing.T, args)
- }
- defaultCheckFunc := func(w want, got Info, err error) error {
- if !errors.Is(err, w.err) {
- return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err)
- }
- opts := []comparator.Option{
- comparator.AllowUnexported(info{}),
- // skipcq: VET-V0008
- comparator.Comparer(func(x, y sync.Once) bool {
- // skipcq: VET-V0008
- return reflect.DeepEqual(x, y)
- }),
- comparator.Comparer(func(x, y func(skip int) (pc uintptr, file string, line int, ok bool)) bool {
- return reflect.ValueOf(x).Pointer() == reflect.ValueOf(y).Pointer()
- }),
- comparator.Comparer(func(x, y func(pc uintptr) *runtime.Func) bool {
- return reflect.ValueOf(x).Pointer() == reflect.ValueOf(y).Pointer()
- }),
- }
- if diff := comparator.Diff(got, w.want, opts...); diff != "" {
- return errors.New(diff)
- }
- return nil
- }
- tests := []test{
- {
- name: "return default info with no option set",
- args: args{
- opts: nil,
- },
- want: want{
- want: &info{
- baseURL: "https://github.com/vdaas/vald/tree/main",
- detail: Detail{
- ServerName: "",
- Version: Version,
- GitCommit: GitCommit,
- BuildTime: BuildTime,
- GoVersion: runtime.Version(),
- GoOS: runtime.GOOS,
- GoArch: runtime.GOARCH,
- GoRoot: runtime.GOROOT(),
- CGOEnabled: cgoUnknown,
- AlgorithmInfo: AlgorithmInfo,
- BuildCPUInfoFlags: strings.Split(strings.TrimSpace(BuildCPUInfoFlags), " "),
- StackTrace: nil,
- },
- prepOnce: func() (o sync.Once) {
- o.Do(func() {})
- return
- }(),
- rtCaller: runtime.Caller,
- rtFuncForPC: runtime.FuncForPC,
- },
- },
- },
- {
- name: "return info when 1 option set",
- args: args{
- opts: []Option{
- WithServerName("gateway"),
- },
- },
- want: want{
- want: &info{
- baseURL: "https://github.com/vdaas/vald/tree/main",
- detail: Detail{
- ServerName: "gateway",
- Version: Version,
- GitCommit: GitCommit,
- BuildTime: BuildTime,
- GoVersion: runtime.Version(),
- GoOS: runtime.GOOS,
- GoArch: runtime.GOARCH,
- GoRoot: runtime.GOROOT(),
- CGOEnabled: cgoUnknown,
- AlgorithmInfo: AlgorithmInfo,
- BuildCPUInfoFlags: strings.Split(strings.TrimSpace(BuildCPUInfoFlags), " "),
- },
- prepOnce: func() (o sync.Once) {
- o.Do(func() {})
- return
- }(),
- rtCaller: runtime.Caller,
- rtFuncForPC: runtime.FuncForPC,
- },
- },
- },
- {
- name: "return info when multiple options set",
- args: args{
- opts: []Option{
- WithServerName("vald"),
- func(i *info) error {
- i.detail.Version = "v1.0.0"
- return nil
- },
- },
- },
- want: want{
- want: &info{
- baseURL: "https://github.com/vdaas/vald/tree/main",
- detail: Detail{
- ServerName: "vald",
- Version: "v1.0.0",
- GitCommit: GitCommit,
- BuildTime: BuildTime,
- GoVersion: runtime.Version(),
- GoOS: runtime.GOOS,
- GoArch: runtime.GOARCH,
- GoRoot: runtime.GOROOT(),
- CGOEnabled: cgoUnknown,
- AlgorithmInfo: AlgorithmInfo,
- BuildCPUInfoFlags: strings.Split(strings.TrimSpace(BuildCPUInfoFlags), " "),
- StackTrace: nil,
- },
- prepOnce: func() (o sync.Once) {
- o.Do(func() {})
- return
- }(),
- rtCaller: runtime.Caller,
- rtFuncForPC: runtime.FuncForPC,
- },
- },
- },
- {
- name: "return info and log the error when an invalid option set",
- args: args{
- opts: []Option{
- func(i *info) error {
- return errors.NewErrInvalidOption("field", "err")
- },
- },
- },
- want: want{
- want: &info{
- baseURL: "https://github.com/vdaas/vald/tree/main",
- detail: Detail{
- ServerName: "",
- Version: Version,
- GitCommit: GitCommit,
- BuildTime: BuildTime,
- GoVersion: runtime.Version(),
- GoOS: runtime.GOOS,
- GoArch: runtime.GOARCH,
- GoRoot: runtime.GOROOT(),
- CGOEnabled: cgoUnknown,
- AlgorithmInfo: AlgorithmInfo,
- BuildCPUInfoFlags: strings.Split(strings.TrimSpace(BuildCPUInfoFlags), " "),
- StackTrace: nil,
- },
- prepOnce: func() (o sync.Once) {
- o.Do(func() {})
- return
- }(),
- rtCaller: runtime.Caller,
- rtFuncForPC: runtime.FuncForPC,
- },
- },
- },
- {
- name: "return an error when a critical error occurred",
- args: args{
- opts: []Option{
- func(i *info) error {
- return errors.NewErrCriticalOption("field", "err")
- },
- },
- },
- want: want{
- err: errors.NewErrCriticalOption("field", "err"),
- },
- },
- }
-
- for _, tc := range tests {
- test := tc
- t.Run(test.name, func(tt *testing.T) {
- defer goleak.VerifyNone(tt, goleakIgnoreOptions...)
- if test.beforeFunc != nil {
- test.beforeFunc(test.args)
- }
- if test.afterFunc != nil {
- defer test.afterFunc(tt, test.args)
- }
- checkFunc := test.checkFunc
- if test.checkFunc == nil {
- checkFunc = defaultCheckFunc
- }
-
- got, err := New(test.args.opts...)
- if err := checkFunc(test.want, got, err); err != nil {
- tt.Errorf("error = %v", err)
- }
- })
- }
-}
-
-func Test_info_String(t *testing.T) {
- type fields struct {
- detail Detail
- rtCaller func(skip int) (pc uintptr, file string, line int, ok bool)
- rtFuncForPC func(pc uintptr) *runtime.Func
- }
- type want struct {
- want *Detail
- }
- type test struct {
- name string
- fields fields
- want want
- checkFunc func(want, string) error
- beforeFunc func()
- afterFunc func(*testing.T)
- }
- defaultCheckFunc := func(w want, got string) error {
- if got == w.want.String() {
- // check the position of "->"
- var oldIdx int
- for i, str := range strings.Split(strings.TrimPrefix(got, "\n"), "\n") {
- idx := strings.Index(str, "->")
- if i != 0 {
- if oldIdx != idx {
- return errors.Errorf("\tgot: \"%v\",\n\t\t\t\twant: \"%v\"", got, w.want)
- }
- }
- oldIdx = idx
- }
- return nil
- }
- return errors.Errorf("\tgot: \"%v\",\n\t\t\t\twant: \"%v\"", got, w.want)
- }
- tests := []test{
- {
- name: "return string with stack trace initialized",
- fields: fields{
- detail: Detail{
- Version: "1.0",
- ServerName: "srv",
- GitCommit: "commit",
- BuildTime: "bt",
- GoVersion: "1.1",
- GoOS: "goos",
- GoArch: "goarch",
- GoRoot: "/usr/local/go",
- CGOEnabled: cgoTrue,
- AlgorithmInfo: "1.2",
- BuildCPUInfoFlags: nil,
- StackTrace: []StackTrace{
- {
- URL: "url",
- FuncName: "func",
- File: "file",
- Line: 10,
- },
- },
- },
- },
- want: want{
- want: &Detail{
- Version: "1.0",
- ServerName: "srv",
- GitCommit: "commit",
- BuildTime: "bt",
- GoVersion: "1.1",
- GoOS: "goos",
- GoArch: "goarch",
- GoRoot: "/usr/local/go",
- CGOEnabled: cgoTrue,
- AlgorithmInfo: "1.2",
- BuildCPUInfoFlags: nil,
- StackTrace: []StackTrace{
- {
- URL: "url",
- FuncName: "func",
- File: "file",
- Line: 10,
- },
- },
- },
- },
- },
- {
- name: "return string with no stack trace initialized",
- fields: fields{
- detail: Detail{
- Version: "1.0",
- ServerName: "srv",
- GitCommit: "commit",
- BuildTime: "bt",
- GoVersion: "1.1",
- GoOS: "goos",
- GoArch: "goarch",
- GoRoot: "/usr/local/go",
- CGOEnabled: cgoTrue,
- AlgorithmInfo: "1.2",
- BuildCPUInfoFlags: nil,
- StackTrace: []StackTrace{},
- },
- rtCaller: func(skip int) (pc uintptr, file string, line int, ok bool) {
- return uintptr(0), "", 0, false
- },
- },
- want: want{
- want: &Detail{
- Version: "1.0",
- ServerName: "srv",
- GitCommit: "commit",
- BuildTime: "bt",
- GoVersion: "1.1",
- GoOS: "goos",
- GoArch: "goarch",
- GoRoot: "/usr/local/go",
- CGOEnabled: cgoTrue,
- AlgorithmInfo: "1.2",
- BuildCPUInfoFlags: nil,
- StackTrace: nil,
- },
- },
- },
- }
-
- for _, tc := range tests {
- test := tc
- t.Run(test.name, func(tt *testing.T) {
- defer goleak.VerifyNone(tt, goleakIgnoreOptions...)
- if test.beforeFunc != nil {
- test.beforeFunc()
- }
- if test.afterFunc != nil {
- defer test.afterFunc(tt)
- }
- checkFunc := test.checkFunc
- if test.checkFunc == nil {
- checkFunc = defaultCheckFunc
- }
- i := info{
- detail: test.fields.detail,
- rtCaller: test.fields.rtCaller,
- rtFuncForPC: test.fields.rtFuncForPC,
- }
-
- got := i.String()
- if err := checkFunc(test.want, got); err != nil {
- tt.Errorf("error = %v", err)
- }
- })
- }
-}
-
-func TestDetail_String(t *testing.T) {
- type fields struct {
- Version string
- ServerName string
- GitCommit string
- BuildTime string
- GoVersion string
- GoOS string
- GoArch string
- CGOEnabled string
- AlgorithmInfo string
- BuildCPUInfoFlags []string
- StackTrace []StackTrace
- }
- type want struct {
- want *Detail
- }
- type test struct {
- name string
- fields fields
- want want
- checkFunc func(want, string) error
- beforeFunc func()
- afterFunc func(*testing.T)
- }
- defaultCheckFunc := func(w want, got string) error {
- if got == w.want.String() {
- // check the position of "->"
- var oldIdx int
- for i, str := range strings.Split(strings.TrimPrefix(got, "\n"), "\n") {
- idx := strings.Index(str, "->")
- if i != 0 {
- if oldIdx != idx {
- return errors.Errorf("\tgot: \"%v\",\n\t\t\t\twant: \"%v\"", got, w.want)
- }
- }
- oldIdx = idx
- }
- return nil
- }
- return errors.Errorf("\tgot: \"%v\",\n\t\t\t\twant: \"%v\"", got, w.want)
- }
- tests := []test{
- {
- name: "return string with stack trace initialized",
- fields: fields{
- Version: "1.0",
- ServerName: "srv",
- GitCommit: "commit",
- BuildTime: "bt",
- GoVersion: "1.1",
- GoOS: "goos",
- GoArch: "goarch",
- CGOEnabled: cgoTrue,
- AlgorithmInfo: "1.2",
- BuildCPUInfoFlags: nil,
- StackTrace: []StackTrace{
- {
- URL: "url",
- FuncName: "func",
- File: "file",
- Line: 10,
- },
- },
- },
- want: want{
- want: &Detail{
- Version: "1.0",
- ServerName: "srv",
- GitCommit: "commit",
- BuildTime: "bt",
- GoVersion: "1.1",
- GoOS: "goos",
- GoArch: "goarch",
- CGOEnabled: cgoTrue,
- AlgorithmInfo: "1.2",
- BuildCPUInfoFlags: nil,
- StackTrace: []StackTrace{
- {
- URL: "url",
- FuncName: "func",
- File: "file",
- Line: 10,
- },
- },
- },
- },
- },
- {
- name: "return string with no stack trace initialized",
- fields: fields{
- Version: "1.0",
- ServerName: "srv",
- GitCommit: "commit",
- BuildTime: "bt",
- GoVersion: "1.1",
- GoOS: "goos",
- GoArch: "goarch",
- CGOEnabled: cgoTrue,
- AlgorithmInfo: "1.2",
- BuildCPUInfoFlags: nil,
- StackTrace: []StackTrace{},
- },
- want: want{
- want: &Detail{
- Version: "1.0",
- ServerName: "srv",
- GitCommit: "commit",
- BuildTime: "bt",
- GoVersion: "1.1",
- GoOS: "goos",
- GoArch: "goarch",
- CGOEnabled: cgoTrue,
- AlgorithmInfo: "1.2",
- BuildCPUInfoFlags: nil,
- StackTrace: nil,
- },
- },
- },
- }
-
- for _, tc := range tests {
- test := tc
- t.Run(test.name, func(tt *testing.T) {
- defer goleak.VerifyNone(tt, goleakIgnoreOptions...)
- if test.beforeFunc != nil {
- test.beforeFunc()
- }
- if test.afterFunc != nil {
- defer test.afterFunc(tt)
- }
- checkFunc := test.checkFunc
- if test.checkFunc == nil {
- checkFunc = defaultCheckFunc
- }
- d := Detail{
- Version: test.fields.Version,
- ServerName: test.fields.ServerName,
- GitCommit: test.fields.GitCommit,
- BuildTime: test.fields.BuildTime,
- GoVersion: test.fields.GoVersion,
- GoOS: test.fields.GoOS,
- GoArch: test.fields.GoArch,
- CGOEnabled: test.fields.CGOEnabled,
- AlgorithmInfo: test.fields.AlgorithmInfo,
- BuildCPUInfoFlags: test.fields.BuildCPUInfoFlags,
- StackTrace: test.fields.StackTrace,
- }
-
- got := d.String()
- if err := checkFunc(test.want, got); err != nil {
- tt.Errorf("error = %v", err)
- }
- })
- }
-}
-
-func Test_info_Get(t *testing.T) {
- type fields struct {
- detail Detail
- rtCaller func(skip int) (pc uintptr, file string, line int, ok bool)
- rtFuncForPC func(pc uintptr) *runtime.Func
- }
- type want struct {
- want Detail
- }
- type test struct {
- name string
- fields fields
- want want
- checkFunc func(want, Detail) error
- beforeFunc func()
- afterFunc func(*testing.T)
- }
- defaultCheckFunc := func(w want, got Detail) error {
- if !reflect.DeepEqual(got, w.want) {
- return errors.Errorf("got: \"%v\",\n\t\t\t\twant: \"%v\"", got, w.want)
- }
- return nil
- }
- tests := []test{
- {
- name: "return detail object with no stack trace",
- fields: fields{
- rtCaller: func(skip int) (pc uintptr, file string, line int, ok bool) {
- return uintptr(0), "", 0, false
- },
- },
- want: want{
- want: Detail{
- ServerName: "",
- Version: "",
- GitCommit: GitCommit,
- GoVersion: runtime.Version(),
- GoOS: runtime.GOOS,
- GoArch: runtime.GOARCH,
- GoRoot: runtime.GOROOT(),
- CGOEnabled: cgoUnknown,
- StackTrace: []StackTrace{},
- AlgorithmInfo: AlgorithmInfo,
- BuildTime: BuildTime,
- BuildCPUInfoFlags: func() []string {
- if len(BuildCPUInfoFlags) == 0 {
- return nil
- }
- return strings.Split(strings.TrimSpace(BuildCPUInfoFlags), " ")
- }(),
- },
- },
- },
- {
- name: "return detail object with stack trace initialized",
- fields: func() fields {
- i := 0
- return fields{
- rtCaller: func(skip int) (pc uintptr, file string, line int, ok bool) {
- if i == 0 {
- i++
- return uintptr(0), "info_test.go", 100, true
- }
- return uintptr(1), "info_test.go", 100, false
- },
- rtFuncForPC: func(ptr uintptr) *runtime.Func {
- return runtime.FuncForPC(reflect.ValueOf(Test_info_Get).Pointer())
- },
- }
- }(),
- want: want{
- want: Detail{
- ServerName: "",
- Version: "",
- GitCommit: GitCommit,
- GoVersion: runtime.Version(),
- GoOS: runtime.GOOS,
- GoArch: runtime.GOARCH,
- GoRoot: runtime.GOROOT(),
- CGOEnabled: cgoUnknown,
- StackTrace: []StackTrace{
- {
- URL: "https://github.com/vdaas/vald/tree/main",
- FuncName: "github.com/vdaas/vald/internal/info.Test_info_Get",
- File: "info_test.go",
- Line: 100,
- },
- },
- AlgorithmInfo: AlgorithmInfo,
- BuildTime: BuildTime,
- BuildCPUInfoFlags: func() []string {
- if len(BuildCPUInfoFlags) == 0 {
- return nil
- }
- return strings.Split(strings.TrimSpace(BuildCPUInfoFlags), " ")
- }(),
- },
- },
- },
- {
- name: "return detail object with the file name has goroot prefix",
- fields: func() fields {
- i := 0
- return fields{
- rtCaller: func(skip int) (pc uintptr, file string, line int, ok bool) {
- if i == 0 {
- i++
- return uintptr(0), runtime.GOROOT() + "/src/info_test.go", 100, true
- }
- return uintptr(1), "info_test.go", 100, false
- },
- rtFuncForPC: func(ptr uintptr) *runtime.Func {
- return runtime.FuncForPC(reflect.ValueOf(Test_info_Get).Pointer())
- },
- }
- }(),
- want: want{
- want: Detail{
- ServerName: "",
- Version: "",
- GitCommit: GitCommit,
- GoVersion: runtime.Version(),
- GoOS: runtime.GOOS,
- GoArch: runtime.GOARCH,
- GoRoot: runtime.GOROOT(),
- CGOEnabled: cgoUnknown,
- StackTrace: []StackTrace{
- {
- URL: "https://github.com/golang/go/blob/" + runtime.Version() + "/src/info_test.go#L100",
- FuncName: "github.com/vdaas/vald/internal/info.Test_info_Get",
- File: runtime.GOROOT() + "/src/info_test.go",
- Line: 100,
- },
- },
- AlgorithmInfo: AlgorithmInfo,
- BuildTime: BuildTime,
- BuildCPUInfoFlags: func() []string {
- if len(BuildCPUInfoFlags) == 0 {
- return nil
- }
- return strings.Split(strings.TrimSpace(BuildCPUInfoFlags), " ")
- }(),
- },
- },
- },
- {
- name: "return detail object with the go mod path set",
- fields: func() fields {
- i := 0
- return fields{
- rtCaller: func(skip int) (pc uintptr, file string, line int, ok bool) {
- if i == 0 {
- i++
- return uintptr(0), "/tmp/go/pkg/mod/github.com/vdaas/vald/internal/info_test.go", 100, true
- }
- return uintptr(1), "info_test.go", 100, false
- },
- rtFuncForPC: func(ptr uintptr) *runtime.Func {
- return runtime.FuncForPC(reflect.ValueOf(Test_info_Get).Pointer())
- },
- }
- }(),
- want: want{
- want: Detail{
- Version: "",
- GitCommit: GitCommit,
- GoVersion: runtime.Version(),
- GoOS: runtime.GOOS,
- GoArch: runtime.GOARCH,
- GoRoot: runtime.GOROOT(),
- CGOEnabled: cgoUnknown,
- StackTrace: []StackTrace{
- {
- URL: "https://github.com/vdaas/vald/internal/info_test.go#L100",
- FuncName: "github.com/vdaas/vald/internal/info.Test_info_Get",
- File: "/tmp/go/pkg/mod/github.com/vdaas/vald/internal/info_test.go",
- Line: 100,
- },
- },
- AlgorithmInfo: AlgorithmInfo,
- BuildTime: BuildTime,
- BuildCPUInfoFlags: func() []string {
- if len(BuildCPUInfoFlags) == 0 {
- return nil
- }
- return strings.Split(strings.TrimSpace(BuildCPUInfoFlags), " ")
- }(),
- },
- },
- },
- {
- name: "return detail object with the go mod path with version set",
- fields: func() fields {
- i := 0
- return fields{
- rtCaller: func(skip int) (pc uintptr, file string, line int, ok bool) {
- if i == 0 {
- i++
- return uintptr(0), "/tmp/go/pkg/mod/github.com/vdaas@v0.0.0-20171023180738-a3a6125de932/vald/internal/info_test.go", 100, true
- }
- return uintptr(1), "info_test.go", 100, false
- },
- rtFuncForPC: func(ptr uintptr) *runtime.Func {
- return runtime.FuncForPC(reflect.ValueOf(Test_info_Get).Pointer())
- },
- }
- }(),
- want: want{
- want: Detail{
- Version: "",
- GitCommit: GitCommit,
- GoVersion: runtime.Version(),
- GoOS: runtime.GOOS,
- GoArch: runtime.GOARCH,
- GoRoot: runtime.GOROOT(),
- CGOEnabled: cgoUnknown,
- StackTrace: []StackTrace{
- {
- URL: "https://github.com/vdaas/blob/v0.0.0-20171023180738-a3a6125de932/vald/internal/info_test.go#L100",
- FuncName: "github.com/vdaas/vald/internal/info.Test_info_Get",
- File: "/tmp/go/pkg/mod/github.com/vdaas@v0.0.0-20171023180738-a3a6125de932/vald/internal/info_test.go",
- Line: 100,
- },
- },
- AlgorithmInfo: AlgorithmInfo,
- BuildTime: BuildTime,
- BuildCPUInfoFlags: func() []string {
- if len(BuildCPUInfoFlags) == 0 {
- return nil
- }
- return strings.Split(strings.TrimSpace(BuildCPUInfoFlags), " ")
- }(),
- },
- },
- },
- {
- name: "return detail object with the go mod path contains pseudo version",
- fields: func() fields {
- i := 0
- return fields{
- rtCaller: func(skip int) (pc uintptr, file string, line int, ok bool) {
- if i == 0 {
- i++
- return uintptr(0), "/tmp/go/pkg/mod/github.com/vdaas@v0.0.0-20171023180738-a3a6125de932-a843423387/vald/internal/info_test.go", 100, true
- }
- return uintptr(1), "info_test.go", 100, false
- },
- rtFuncForPC: func(ptr uintptr) *runtime.Func {
- return runtime.FuncForPC(reflect.ValueOf(Test_info_Get).Pointer())
- },
- }
- }(),
- want: want{
- want: Detail{
- Version: "",
- GitCommit: GitCommit,
- GoVersion: runtime.Version(),
- GoOS: runtime.GOOS,
- GoArch: runtime.GOARCH,
- GoRoot: runtime.GOROOT(),
- CGOEnabled: cgoUnknown,
- StackTrace: []StackTrace{
- {
- URL: "https://github.com/vdaas/blob/main/vald/internal/info_test.go#L100",
- FuncName: "github.com/vdaas/vald/internal/info.Test_info_Get",
- File: "/tmp/go/pkg/mod/github.com/vdaas@v0.0.0-20171023180738-a3a6125de932-a843423387/vald/internal/info_test.go",
- Line: 100,
- },
- },
- AlgorithmInfo: AlgorithmInfo,
- BuildTime: BuildTime,
- BuildCPUInfoFlags: func() []string {
- if len(BuildCPUInfoFlags) == 0 {
- return nil
- }
- return strings.Split(strings.TrimSpace(BuildCPUInfoFlags), " ")
- }(),
- },
- },
- },
- {
- name: "return detail object with the go src path set",
- fields: func() fields {
- i := 0
- return fields{
- rtCaller: func(skip int) (pc uintptr, file string, line int, ok bool) {
- if i == 0 {
- i++
- return uintptr(0), "/tmp/go/src/github.com/vdaas/vald/internal/info_test.go", 100, true
- }
- return uintptr(1), "info_test.go", 100, false
- },
- rtFuncForPC: func(ptr uintptr) *runtime.Func {
- return runtime.FuncForPC(reflect.ValueOf(Test_info_Get).Pointer())
- },
- }
- }(),
- want: want{
- want: Detail{
- Version: "",
- GitCommit: GitCommit,
- GoVersion: runtime.Version(),
- GoOS: runtime.GOOS,
- GoArch: runtime.GOARCH,
- GoRoot: runtime.GOROOT(),
- CGOEnabled: cgoUnknown,
- StackTrace: []StackTrace{
- {
- URL: "https://github.com/vdaas/vald/blob/main/internal/info_test.go#L100",
- FuncName: "github.com/vdaas/vald/internal/info.Test_info_Get",
- File: "/tmp/go/src/github.com/vdaas/vald/internal/info_test.go",
- Line: 100,
- },
- },
- AlgorithmInfo: AlgorithmInfo,
- BuildTime: BuildTime,
- BuildCPUInfoFlags: func() []string {
- if len(BuildCPUInfoFlags) == 0 {
- return nil
- }
- return strings.Split(strings.TrimSpace(BuildCPUInfoFlags), " ")
- }(),
- },
- },
- },
- }
-
- for _, tc := range tests {
- test := tc
- t.Run(test.name, func(tt *testing.T) {
- defer goleak.VerifyNone(tt, goleakIgnoreOptions...)
- if test.beforeFunc != nil {
- test.beforeFunc()
- }
- if test.afterFunc != nil {
- defer test.afterFunc(tt)
- }
- checkFunc := test.checkFunc
- if test.checkFunc == nil {
- checkFunc = defaultCheckFunc
- }
- i := info{
- detail: test.fields.detail,
- rtCaller: test.fields.rtCaller,
- rtFuncForPC: test.fields.rtFuncForPC,
- }
-
- got := i.Get()
- if err := checkFunc(test.want, got); err != nil {
- tt.Errorf("error = %v", err)
- }
- })
- }
-}
-
-func Test_info_prepare(t *testing.T) {
- type fields struct {
- detail Detail
- rtCaller func(skip int) (pc uintptr, file string, line int, ok bool)
- rtFuncForPC func(pc uintptr) *runtime.Func
- }
- type want struct {
- want info
- }
- type test struct {
- name string
- fields fields
- want want
- checkFunc func(info, want) error
- beforeFunc func()
- afterFunc func(*testing.T)
- }
- // skipcq: VET-V0008
- defaultCheckFunc := func(got info, w want) error {
- opts := []comparator.Option{
- comparator.AllowUnexported(info{}),
- comparator.IgnoreFields(info{}, "prepOnce"),
- }
- // skipcq: VET-V0008
- if diff := comparator.Diff(w.want, got, opts...); len(diff) != 0 {
- return errors.Errorf("err: %s", diff)
- }
- return nil
- }
- tests := []*test{
- {
- name: "set success with all fields are empty",
- want: want{
- want: info{
- baseURL: "https://github.com/vdaas/vald/tree/main",
- detail: Detail{
- GitCommit: GitCommit,
- Version: "",
- BuildTime: BuildTime,
- GoVersion: runtime.Version(),
- GoOS: runtime.GOOS,
- GoArch: runtime.GOARCH,
- GoRoot: runtime.GOROOT(),
- CGOEnabled: cgoUnknown,
- AlgorithmInfo: AlgorithmInfo,
- BuildCPUInfoFlags: func() []string {
- if len(BuildCPUInfoFlags) == 0 {
- return nil
- }
- return strings.Split(strings.TrimSpace(BuildCPUInfoFlags), " ")
- }(),
- },
- },
- },
- },
- {
- name: "set success with GitCommit set",
- fields: fields{
- detail: Detail{
- GitCommit: "internal",
- },
- },
- want: want{
- want: info{
- baseURL: "https://github.com/vdaas/vald/tree/internal",
- detail: Detail{
- GitCommit: "internal",
- Version: "",
- BuildTime: BuildTime,
- GoVersion: runtime.Version(),
- GoOS: runtime.GOOS,
- GoArch: runtime.GOARCH,
- GoRoot: runtime.GOROOT(),
- CGOEnabled: cgoUnknown,
- AlgorithmInfo: AlgorithmInfo,
- BuildCPUInfoFlags: func() []string {
- if len(BuildCPUInfoFlags) == 0 {
- return nil
- }
- return strings.Split(strings.TrimSpace(BuildCPUInfoFlags), " ")
- }(),
- },
- },
- },
- },
- {
- name: "set success with Version set",
- fields: fields{
- detail: Detail{
- Version: "v1.0.0",
- },
- },
- want: want{
- want: info{
- baseURL: "https://github.com/vdaas/vald/tree/main",
- detail: Detail{
- GitCommit: GitCommit,
- Version: "v1.0.0",
- BuildTime: BuildTime,
- GoVersion: runtime.Version(),
- GoOS: runtime.GOOS,
- GoArch: runtime.GOARCH,
- GoRoot: runtime.GOROOT(),
- CGOEnabled: cgoUnknown,
- AlgorithmInfo: AlgorithmInfo,
- BuildCPUInfoFlags: func() []string {
- if len(BuildCPUInfoFlags) == 0 {
- return nil
- }
- return strings.Split(strings.TrimSpace(BuildCPUInfoFlags), " ")
- }(),
- },
- },
- },
- },
- {
- name: "set success with BuildTime set",
- fields: fields{
- detail: Detail{
- BuildTime: "10s",
- },
- },
- want: want{
- want: info{
- baseURL: "https://github.com/vdaas/vald/tree/main",
- detail: Detail{
- GitCommit: GitCommit,
- Version: "",
- BuildTime: "10s",
- GoVersion: runtime.Version(),
- GoOS: runtime.GOOS,
- GoArch: runtime.GOARCH,
- GoRoot: runtime.GOROOT(),
- CGOEnabled: cgoUnknown,
- AlgorithmInfo: AlgorithmInfo,
- BuildCPUInfoFlags: func() []string {
- if len(BuildCPUInfoFlags) == 0 {
- return nil
- }
- return strings.Split(strings.TrimSpace(BuildCPUInfoFlags), " ")
- }(),
- },
- },
- },
- },
- {
- name: "set success with GoVersion set",
- fields: fields{
- detail: Detail{
- GoVersion: "1.14",
- },
- },
- want: want{
- want: info{
- baseURL: "https://github.com/vdaas/vald/tree/main",
- detail: Detail{
- GitCommit: GitCommit,
- Version: "",
- BuildTime: BuildTime,
- GoVersion: "1.14",
- GoOS: runtime.GOOS,
- GoArch: runtime.GOARCH,
- GoRoot: runtime.GOROOT(),
- CGOEnabled: cgoUnknown,
- AlgorithmInfo: AlgorithmInfo,
- BuildCPUInfoFlags: func() []string {
- if len(BuildCPUInfoFlags) == 0 {
- return nil
- }
- return strings.Split(strings.TrimSpace(BuildCPUInfoFlags), " ")
- }(),
- },
- },
- },
- },
- {
- name: "set success with GoOS set",
- fields: fields{
- detail: Detail{
- GoOS: "linux",
- },
- },
- want: want{
- want: info{
- baseURL: "https://github.com/vdaas/vald/tree/main",
- detail: Detail{
- GitCommit: GitCommit,
- Version: "",
- BuildTime: BuildTime,
- GoVersion: runtime.Version(),
- GoOS: "linux",
- GoArch: runtime.GOARCH,
- GoRoot: runtime.GOROOT(),
- CGOEnabled: cgoUnknown,
- AlgorithmInfo: AlgorithmInfo,
- BuildCPUInfoFlags: func() []string {
- if len(BuildCPUInfoFlags) == 0 {
- return nil
- }
- return strings.Split(strings.TrimSpace(BuildCPUInfoFlags), " ")
- }(),
- },
- },
- },
- },
- {
- name: "set success with GoArch set",
- fields: fields{
- detail: Detail{
- GoArch: "amd",
- },
- },
- want: want{
- want: info{
- baseURL: "https://github.com/vdaas/vald/tree/main",
- detail: Detail{
- GitCommit: GitCommit,
- Version: "",
- BuildTime: BuildTime,
- GoVersion: runtime.Version(),
- GoOS: runtime.GOOS,
- GoArch: "amd",
- GoRoot: runtime.GOROOT(),
- CGOEnabled: cgoUnknown,
- AlgorithmInfo: AlgorithmInfo,
- BuildCPUInfoFlags: func() []string {
- if len(BuildCPUInfoFlags) == 0 {
- return nil
- }
- return strings.Split(strings.TrimSpace(BuildCPUInfoFlags), " ")
- }(),
- },
- },
- },
- },
- {
- name: "set success with CGOEnabled set as true",
- fields: fields{
- detail: Detail{
- CGOEnabled: "1",
- },
- },
- want: want{
- want: info{
- baseURL: "https://github.com/vdaas/vald/tree/main",
- detail: Detail{
- GitCommit: GitCommit,
- Version: "",
- BuildTime: BuildTime,
- GoVersion: runtime.Version(),
- GoOS: runtime.GOOS,
- GoArch: runtime.GOARCH,
- GoRoot: runtime.GOROOT(),
- CGOEnabled: cgoTrue,
- AlgorithmInfo: AlgorithmInfo,
- BuildCPUInfoFlags: func() []string {
- if len(BuildCPUInfoFlags) == 0 {
- return nil
- }
- return strings.Split(strings.TrimSpace(BuildCPUInfoFlags), " ")
- }(),
- },
- },
- },
- },
- {
- name: "set success with CGOEnabled set as false",
- fields: fields{
- detail: Detail{
- CGOEnabled: "0",
- },
- },
- want: want{
- want: info{
- baseURL: "https://github.com/vdaas/vald/tree/main",
- detail: Detail{
- GitCommit: GitCommit,
- Version: "",
- BuildTime: BuildTime,
- GoVersion: runtime.Version(),
- GoOS: runtime.GOOS,
- GoArch: runtime.GOARCH,
- GoRoot: runtime.GOROOT(),
- CGOEnabled: cgoFalse,
- AlgorithmInfo: AlgorithmInfo,
- BuildCPUInfoFlags: func() []string {
- if len(BuildCPUInfoFlags) == 0 {
- return nil
- }
- return strings.Split(strings.TrimSpace(BuildCPUInfoFlags), " ")
- }(),
- },
- },
- },
- },
- {
- name: "set success with AlgorithmInfo set",
- fields: fields{
- detail: Detail{
- AlgorithmInfo: "v1.11.5",
- },
- },
- want: want{
- want: info{
- baseURL: "https://github.com/vdaas/vald/tree/main",
- detail: Detail{
- GitCommit: GitCommit,
- Version: "",
- BuildTime: BuildTime,
- GoVersion: runtime.Version(),
- GoOS: runtime.GOOS,
- GoArch: runtime.GOARCH,
- GoRoot: runtime.GOROOT(),
- CGOEnabled: cgoUnknown,
- AlgorithmInfo: "v1.11.5",
- BuildCPUInfoFlags: func() []string {
- if len(BuildCPUInfoFlags) == 0 {
- return nil
- }
- return strings.Split(strings.TrimSpace(BuildCPUInfoFlags), " ")
- }(),
- },
- },
- },
- },
- {
- name: "set success with BuildCPUInfoFlags set",
- fields: fields{
- detail: Detail{
- BuildCPUInfoFlags: []string{"avx512f"},
- },
- },
- want: want{
- want: info{
- baseURL: "https://github.com/vdaas/vald/tree/main",
- detail: Detail{
- GitCommit: GitCommit,
- Version: "",
- BuildTime: BuildTime,
- GoVersion: runtime.Version(),
- GoOS: runtime.GOOS,
- GoArch: runtime.GOARCH,
- GoRoot: runtime.GOROOT(),
- CGOEnabled: cgoUnknown,
- AlgorithmInfo: AlgorithmInfo,
- BuildCPUInfoFlags: []string{"avx512f"},
- },
- },
- },
- },
- }
-
- for i := range tests {
- test := tests[i]
- t.Run(test.name, func(tt *testing.T) {
- defer goleak.VerifyNone(tt, goleakIgnoreOptions...)
- if test.beforeFunc != nil {
- test.beforeFunc()
- }
- if test.afterFunc != nil {
- defer test.afterFunc(tt)
- }
- checkFunc := test.checkFunc
- if test.checkFunc == nil {
- checkFunc = defaultCheckFunc
- }
- i := &info{
- detail: test.fields.detail,
- rtCaller: test.fields.rtCaller,
- rtFuncForPC: test.fields.rtFuncForPC,
- }
- i.prepare()
- if err := checkFunc(*i, test.want); err != nil {
- tt.Errorf("error = %v", err)
- }
- })
- }
-}
-
-func TestStackTrace_String(t *testing.T) {
- type fields struct {
- URL string
- FuncName string
- File string
- Line int
- }
- type want struct {
- want string
- }
- type test struct {
- name string
- fields fields
- want want
- checkFunc func(want, string) error
- beforeFunc func()
- afterFunc func(*testing.T)
- }
- defaultCheckFunc := func(w want, got string) error {
- if !reflect.DeepEqual(got, w.want) {
- return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want)
- }
- return nil
- }
- tests := []test{
- {
- name: "return stack trace string",
- fields: fields{
- URL: "https://github.com/golang/go/blob/v1.0.0/internal/info/info_test.go#L40",
- FuncName: "TestStackTrace_String",
- File: "info_test.go",
- Line: 40,
- },
- want: want{
- want: "URL: https://github.com/golang/go/blob/v1.0.0/internal/info/info_test.go#L40\tFile: info_test.go\tLine: #40\tFuncName: TestStackTrace_String",
- },
- },
- }
-
- for _, tc := range tests {
- test := tc
- t.Run(test.name, func(tt *testing.T) {
- defer goleak.VerifyNone(tt, goleakIgnoreOptions...)
- if test.beforeFunc != nil {
- test.beforeFunc()
- }
- if test.afterFunc != nil {
- defer test.afterFunc(tt)
- }
- checkFunc := test.checkFunc
- if test.checkFunc == nil {
- checkFunc = defaultCheckFunc
- }
- s := StackTrace{
- URL: test.fields.URL,
- FuncName: test.fields.FuncName,
- File: test.fields.File,
- Line: test.fields.Line,
- }
-
- got := s.String()
- if err := checkFunc(test.want, got); err != nil {
- tt.Errorf("error = %v", err)
- }
- })
- }
-}
-
-// NOT IMPLEMENTED BELOW
-//
-// func Test_info_getDetail(t *testing.T) {
-// type fields struct {
-// baseURL string
-// detail Detail
-// rtCaller func(skip int) (pc uintptr, file string, line int, ok bool)
-// rtFuncForPC func(pc uintptr) *runtime.Func
-// }
-// type want struct {
-// want Detail
-// }
-// type test struct {
-// name string
-// fields fields
-// want want
-// checkFunc func(want, Detail) error
-// beforeFunc func(*testing.T)
-// afterFunc func(*testing.T)
-// }
-// defaultCheckFunc := func(w want, got Detail) error {
-// if !reflect.DeepEqual(got, w.want) {
-// return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want)
-// }
-// return nil
-// }
-// tests := []test{
-// // TODO test cases
-// /*
-// {
-// name: "test_case_1",
-// fields: fields {
-// baseURL:"",
-// detail:Detail{},
-// rtCaller:nil,
-// rtFuncForPC:nil,
-// },
-// want: want{},
-// checkFunc: defaultCheckFunc,
-// beforeFunc: func(t *testing.T,) {
-// t.Helper()
-// },
-// afterFunc: func(t *testing.T,) {
-// t.Helper()
-// },
-// },
-// */
-//
-// // TODO test cases
-// /*
-// func() test {
-// return test {
-// name: "test_case_2",
-// fields: fields {
-// baseURL:"",
-// detail:Detail{},
-// rtCaller:nil,
-// rtFuncForPC:nil,
-// },
-// want: want{},
-// checkFunc: defaultCheckFunc,
-// beforeFunc: func(t *testing.T,) {
-// t.Helper()
-// },
-// afterFunc: func(t *testing.T,) {
-// t.Helper()
-// },
-// }
-// }(),
-// */
-// }
-//
-// for _, tc := range tests {
-// test := tc
-// t.Run(test.name, func(tt *testing.T) {
-// tt.Parallel()
-// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent())
-// if test.beforeFunc != nil {
-// test.beforeFunc(tt)
-// }
-// if test.afterFunc != nil {
-// defer test.afterFunc(tt)
-// }
-// checkFunc := test.checkFunc
-// if test.checkFunc == nil {
-// checkFunc = defaultCheckFunc
-// }
-// i := info{
-// baseURL: test.fields.baseURL,
-// detail: test.fields.detail,
-// rtCaller: test.fields.rtCaller,
-// rtFuncForPC: test.fields.rtFuncForPC,
-// }
-//
-// got := i.getDetail()
-// if err := checkFunc(test.want, got); err != nil {
-// tt.Errorf("error = %v", err)
-// }
-//
-// })
-// }
-// }
diff --git a/internal/info/option_test.go b/internal/info/option_test.go
index b73b026daf..63c58e79b8 100644
--- a/internal/info/option_test.go
+++ b/internal/info/option_test.go
@@ -24,6 +24,11 @@ import (
"github.com/vdaas/vald/internal/test/goleak"
)
+// Goroutine leak is detected by `fastime`, but it should be ignored in the test because it is an external package.
+var goleakIgnoreOptions = []goleak.Option{
+ goleak.IgnoreTopFunction("github.com/kpango/fastime.(*fastime).StartTimerD.func1"),
+}
+
func TestWithServerName(t *testing.T) {
type T = info
type args struct {
diff --git a/internal/io/copy.go b/internal/io/copy.go
index b7d1c7c6c2..a31a21b12f 100644
--- a/internal/io/copy.go
+++ b/internal/io/copy.go
@@ -58,7 +58,7 @@ func NewCopier(size int) Copier {
atomic.StoreInt64(&c.bufSize, int64(defaultBufferSize))
}
c.pool = sync.Pool{
- New: func() interface{} {
+ New: func() any {
return bytes.NewBuffer(make([]byte, int(atomic.LoadInt64(&c.bufSize))))
},
}
@@ -81,7 +81,9 @@ func (c *copier) CopyBuffer(dst io.Writer, src io.Reader, buf []byte) (written i
return c.copyBuffer(dst, src, b)
}
-func (c *copier) copyBuffer(dst io.Writer, src io.Reader, buf *bytes.Buffer) (written int64, err error) {
+func (c *copier) copyBuffer(
+ dst io.Writer, src io.Reader, buf *bytes.Buffer,
+) (written int64, err error) {
if dst == nil || src == nil {
return 0, errors.New("empty source or destination")
}
diff --git a/internal/io/copy_test.go b/internal/io/copy_test.go
index 9c3aafb88f..099afd9f1b 100644
--- a/internal/io/copy_test.go
+++ b/internal/io/copy_test.go
@@ -328,7 +328,7 @@ func Test_copier_Copy(t *testing.T) {
bufSize: test.fields.bufSize,
}
c.pool = sync.Pool{
- New: func() interface{} {
+ New: func() any {
return bytes.NewBuffer(make([]byte, int(atomic.LoadInt64(&c.bufSize))))
},
}
diff --git a/internal/io/io.go b/internal/io/io.go
index 51fb0fa637..13680c7924 100644
--- a/internal/io/io.go
+++ b/internal/io/io.go
@@ -48,7 +48,7 @@ var (
ErrShortBuffer = io.ErrShortBuffer
bufferPool = sync.Pool{
- New: func() interface{} {
+ New: func() any {
return bytes.NewBuffer(make([]byte, 0, bytes.MinRead*2))
},
}
diff --git a/internal/k8s/client/client.go b/internal/k8s/client/client.go
index f02d15b7f7..a580438aec 100644
--- a/internal/k8s/client/client.go
+++ b/internal/k8s/client/client.go
@@ -117,7 +117,9 @@ func New(opts ...Option) (_ Client, err error) {
return c, nil
}
-func (c *client) Get(ctx context.Context, name, namespace string, obj cli.Object, opts ...cli.GetOption) error {
+func (c *client) Get(
+ ctx context.Context, name, namespace string, obj cli.Object, opts ...cli.GetOption,
+) error {
return c.withWatch.Get(
ctx,
cli.ObjectKey{
@@ -145,11 +147,15 @@ func (c *client) Update(ctx context.Context, obj k8s.Object, opts ...cli.UpdateO
return c.withWatch.Update(ctx, obj, opts...)
}
-func (c *client) Patch(ctx context.Context, obj k8s.Object, patch cli.Patch, opts ...cli.PatchOption) error {
+func (c *client) Patch(
+ ctx context.Context, obj k8s.Object, patch cli.Patch, opts ...cli.PatchOption,
+) error {
return c.withWatch.Patch(ctx, obj, patch, opts...)
}
-func (c *client) Watch(ctx context.Context, obj cli.ObjectList, opts ...k8s.ListOption) (watch.Interface, error) {
+func (c *client) Watch(
+ ctx context.Context, obj cli.ObjectList, opts ...k8s.ListOption,
+) (watch.Interface, error) {
return c.withWatch.Watch(ctx, obj, opts...)
}
@@ -157,7 +163,9 @@ func (*client) MatchingLabels(labels map[string]string) cli.MatchingLabels {
return cli.MatchingLabels(labels)
}
-func (*client) LabelSelector(key string, op selection.Operator, vals []string) (labels.Selector, error) {
+func (*client) LabelSelector(
+ key string, op selection.Operator, vals []string,
+) (labels.Selector, error) {
requirements, err := labels.NewRequirement(key, op, vals)
if err != nil {
return nil, fmt.Errorf("failed to create requirement on creating label selector: %w", err)
@@ -222,7 +230,9 @@ func NewPatcher(fieldManager string) (Patcher, error) {
}, nil
}
-func (s *patcher) ApplyPodAnnotations(ctx context.Context, name, namespace string, entries map[string]string) error {
+func (s *patcher) ApplyPodAnnotations(
+ ctx context.Context, name, namespace string, entries map[string]string,
+) error {
var podList corev1.PodList
if err := s.client.List(ctx, &podList, &cli.ListOptions{
Namespace: namespace,
@@ -235,7 +245,7 @@ func (s *patcher) ApplyPodAnnotations(ctx context.Context, name, namespace strin
return errors.New("agent pod not found on exporting metrics")
}
- //nolint: gomnd
+ //nolint:gomnd
if len(podList.Items) >= 2 {
return errors.New("multiple agent pods found on exporting metrics. pods with same name exist in the same namespace?")
}
diff --git a/internal/k8s/client/option.go b/internal/k8s/client/option.go
index cdde4fc2c1..31590191ac 100644
--- a/internal/k8s/client/option.go
+++ b/internal/k8s/client/option.go
@@ -17,9 +17,7 @@
// Package client is Kubernetes client for getting resource from Kubernetes cluster.
package client
-import (
- "sigs.k8s.io/controller-runtime/pkg/scheme"
-)
+import "sigs.k8s.io/controller-runtime/pkg/scheme"
type Option func(*client) error
diff --git a/internal/k8s/job/job.go b/internal/k8s/job/job.go
index d714900d69..db984ef28c 100644
--- a/internal/k8s/job/job.go
+++ b/internal/k8s/job/job.go
@@ -49,7 +49,7 @@ type reconciler struct {
func New(opts ...Option) (JobWatcher, error) {
r := &reconciler{
jobsByAppNamePool: sync.Pool{
- New: func() interface{} {
+ New: func() any {
return make(map[string][]k8s.Job)
},
},
@@ -72,7 +72,9 @@ func New(opts ...Option) (JobWatcher, error) {
}
// Reconcile implements k8s reconciliation loop to retrieve the Job information from k8s.
-func (r *reconciler) Reconcile(ctx context.Context, _ reconcile.Request) (res reconcile.Result, err error) {
+func (r *reconciler) Reconcile(
+ ctx context.Context, _ reconcile.Request,
+) (res reconcile.Result, err error) {
js := new(batchv1.JobList)
err = r.mgr.GetClient().List(ctx, js, r.listOpts...)
diff --git a/internal/k8s/metrics/node/node.go b/internal/k8s/metrics/node/node.go
index ab8fb8eb4e..ae4eeacb27 100644
--- a/internal/k8s/metrics/node/node.go
+++ b/internal/k8s/metrics/node/node.go
@@ -69,7 +69,9 @@ func (r *reconciler) addListOpts(opt client.ListOption) {
r.lopts = append(r.lopts, opt)
}
-func (r *reconciler) Reconcile(ctx context.Context, _ reconcile.Request) (res reconcile.Result, err error) {
+func (r *reconciler) Reconcile(
+ ctx context.Context, _ reconcile.Request,
+) (res reconcile.Result, err error) {
m := &metrics.NodeMetricsList{}
if r.lopts != nil {
diff --git a/internal/k8s/metrics/pod/pod.go b/internal/k8s/metrics/pod/pod.go
index 6eb1e46844..398861fa23 100644
--- a/internal/k8s/metrics/pod/pod.go
+++ b/internal/k8s/metrics/pod/pod.go
@@ -69,7 +69,9 @@ func (r *reconciler) addListOpts(opt client.ListOption) {
r.lopts = append(r.lopts, opt)
}
-func (r *reconciler) Reconcile(ctx context.Context, _ reconcile.Request) (res reconcile.Result, err error) {
+func (r *reconciler) Reconcile(
+ ctx context.Context, _ reconcile.Request,
+) (res reconcile.Result, err error) {
m := &metrics.PodMetricsList{}
if r.lopts != nil {
diff --git a/internal/k8s/node/node.go b/internal/k8s/node/node.go
index 5a9d649666..8d5d57452f 100644
--- a/internal/k8s/node/node.go
+++ b/internal/k8s/node/node.go
@@ -73,7 +73,9 @@ func (r *reconciler) addListOpts(opt client.ListOption) {
r.lopts = append(r.lopts, opt)
}
-func (r *reconciler) Reconcile(ctx context.Context, _ reconcile.Request) (res reconcile.Result, err error) {
+func (r *reconciler) Reconcile(
+ ctx context.Context, _ reconcile.Request,
+) (res reconcile.Result, err error) {
ns := &corev1.NodeList{}
if r.lopts != nil {
@@ -91,10 +93,11 @@ func (r *reconciler) Reconcile(ctx context.Context, _ reconcile.Request) (res re
RequeueAfter: time.Millisecond * 100,
}
if errors.IsNotFound(err) {
- res = reconcile.Result{
+ log.Errorf("not found: %s", err)
+ return reconcile.Result{
Requeue: true,
RequeueAfter: time.Second,
- }
+ }, nil
}
return
}
@@ -149,12 +152,12 @@ func (r *reconciler) GetName() string {
return r.name
}
-func (r *reconciler) NewReconciler(_ context.Context, mgr manager.Manager) reconcile.Reconciler {
+func (r *reconciler) NewReconciler(ctx context.Context, mgr manager.Manager) reconcile.Reconciler {
if r.mgr == nil && mgr != nil {
r.mgr = mgr
}
corev1.AddToScheme(r.mgr.GetScheme())
- if err := r.mgr.GetFieldIndexer().IndexField(context.Background(), &corev1.Node{}, "status.phase", func(obj client.Object) []string {
+ if err := r.mgr.GetFieldIndexer().IndexField(ctx, &corev1.Node{}, "status.phase", func(obj client.Object) []string {
node, ok := obj.(*corev1.Node)
if !ok || node.GetDeletionTimestamp() != nil {
return nil
diff --git a/internal/k8s/node/node_test.go b/internal/k8s/node/node_test.go
index f779c710f4..ada6e65b58 100644
--- a/internal/k8s/node/node_test.go
+++ b/internal/k8s/node/node_test.go
@@ -17,9 +17,7 @@
// Package node provides kubernetes node information and preriodically update
package node
-import (
- _ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
-)
+import _ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
// NOT IMPLEMENTED BELOW
//
diff --git a/internal/k8s/pod/pod.go b/internal/k8s/pod/pod.go
index 1229f1620c..065ec1419c 100644
--- a/internal/k8s/pod/pod.go
+++ b/internal/k8s/pod/pod.go
@@ -76,7 +76,9 @@ func (r *reconciler) addListOpts(opt client.ListOption) {
r.lopts = append(r.lopts, opt)
}
-func (r *reconciler) Reconcile(ctx context.Context, _ reconcile.Request) (res reconcile.Result, err error) {
+func (r *reconciler) Reconcile(
+ ctx context.Context, _ reconcile.Request,
+) (res reconcile.Result, err error) {
ps := &corev1.PodList{}
if r.lopts != nil {
diff --git a/internal/k8s/service/service.go b/internal/k8s/service/service.go
index f15b62d4dd..0a499ac483 100644
--- a/internal/k8s/service/service.go
+++ b/internal/k8s/service/service.go
@@ -94,7 +94,9 @@ func extractAPIPorts(ports []corev1.ServicePort) []servicePort {
}
// Reconcile reconciles the service resources and put the information into the Service struct.
-func (r *reconciler) Reconcile(ctx context.Context, _ reconcile.Request) (res reconcile.Result, err error) {
+func (r *reconciler) Reconcile(
+ ctx context.Context, _ reconcile.Request,
+) (res reconcile.Result, err error) {
svcList := &corev1.ServiceList{}
if r.lopts != nil {
diff --git a/internal/k8s/v2/pod/option.go b/internal/k8s/v2/pod/option.go
index 88839d4395..b6bb554763 100644
--- a/internal/k8s/v2/pod/option.go
+++ b/internal/k8s/v2/pod/option.go
@@ -52,7 +52,9 @@ func WithOnErrorFunc(f func(err error)) Option {
}
}
-func WithOnReconcileFunc(f func(ctx context.Context, pod *corev1.Pod) (reconcile.Result, error)) Option {
+func WithOnReconcileFunc(
+ f func(ctx context.Context, pod *corev1.Pod) (reconcile.Result, error),
+) Option {
return func(r *reconciler) error {
r.onReconcile = f
return nil
diff --git a/internal/k8s/v2/pod/pod.go b/internal/k8s/v2/pod/pod.go
index e24cf48e19..7ec2e1b2ff 100644
--- a/internal/k8s/v2/pod/pod.go
+++ b/internal/k8s/v2/pod/pod.go
@@ -74,7 +74,9 @@ func (r *reconciler) addListOpts(opt client.ListOption) {
r.lopts = append(r.lopts, opt)
}
-func (r *reconciler) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error) {
+func (r *reconciler) Reconcile(
+ ctx context.Context, req reconcile.Request,
+) (reconcile.Result, error) {
var pod corev1.Pod
r.mgr.GetClient().Get(ctx, req.NamespacedName, &pod)
if r.onReconcile != nil {
diff --git a/internal/k8s/vald/benchmark/job/job.go b/internal/k8s/vald/benchmark/job/job.go
index 60538c5b56..7325f5037c 100644
--- a/internal/k8s/vald/benchmark/job/job.go
+++ b/internal/k8s/vald/benchmark/job/job.go
@@ -76,7 +76,9 @@ func (r *reconciler) AddListOpts(opt client.ListOption) {
r.lopts = append(r.lopts, opt)
}
-func (r *reconciler) Reconcile(ctx context.Context, _ reconcile.Request) (res reconcile.Result, err error) {
+func (r *reconciler) Reconcile(
+ ctx context.Context, _ reconcile.Request,
+) (res reconcile.Result, err error) {
bj := new(v1.ValdBenchmarkJobList)
err = r.mgr.GetClient().List(ctx, bj, r.lopts...)
diff --git a/internal/k8s/vald/benchmark/job/option.go b/internal/k8s/vald/benchmark/job/option.go
index f0d231f153..a6fdffa683 100644
--- a/internal/k8s/vald/benchmark/job/option.go
+++ b/internal/k8s/vald/benchmark/job/option.go
@@ -60,7 +60,9 @@ func WithOnErrorFunc(f func(err error)) Option {
}
// WithOnReconcileFunc returns Option that sets r.onReconcile.
-func WithOnReconcileFunc(f func(ctx context.Context, jobList map[string]v1.ValdBenchmarkJob)) Option {
+func WithOnReconcileFunc(
+ f func(ctx context.Context, jobList map[string]v1.ValdBenchmarkJob),
+) Option {
return func(r *reconciler) error {
r.onReconcile = f
return nil
diff --git a/internal/k8s/vald/benchmark/scenario/option.go b/internal/k8s/vald/benchmark/scenario/option.go
index 6a1b7d0e26..1880426720 100644
--- a/internal/k8s/vald/benchmark/scenario/option.go
+++ b/internal/k8s/vald/benchmark/scenario/option.go
@@ -60,7 +60,9 @@ func WithOnErrorFunc(f func(err error)) Option {
}
// WithOnReconcileFunc returns Option that sets r.onReconcile.
-func WithOnReconcileFunc(f func(ctx context.Context, scenarioList map[string]v1.ValdBenchmarkScenario)) Option {
+func WithOnReconcileFunc(
+ f func(ctx context.Context, scenarioList map[string]v1.ValdBenchmarkScenario),
+) Option {
return func(r *reconciler) error {
r.onReconcile = f
return nil
diff --git a/internal/k8s/vald/benchmark/scenario/scenario.go b/internal/k8s/vald/benchmark/scenario/scenario.go
index eb1d7f89ac..6e07d0a2e8 100644
--- a/internal/k8s/vald/benchmark/scenario/scenario.go
+++ b/internal/k8s/vald/benchmark/scenario/scenario.go
@@ -65,7 +65,9 @@ func (r *reconciler) AddListOpts(opt client.ListOption) {
r.lopts = append(r.lopts, opt)
}
-func (r *reconciler) Reconcile(ctx context.Context, _ reconcile.Request) (res reconcile.Result, err error) {
+func (r *reconciler) Reconcile(
+ ctx context.Context, _ reconcile.Request,
+) (res reconcile.Result, err error) {
bs := new(v1.ValdBenchmarkScenarioList)
err = r.mgr.GetClient().List(ctx, bs, r.lopts...)
diff --git a/internal/k8s/vald/mirror/target/target.go b/internal/k8s/vald/mirror/target/target.go
index cbfb1f60ae..aeba23c73e 100644
--- a/internal/k8s/vald/mirror/target/target.go
+++ b/internal/k8s/vald/mirror/target/target.go
@@ -87,7 +87,9 @@ func (r *reconciler) addListOpts(opt client.ListOption) {
r.lopts = append(r.lopts, opt)
}
-func (r *reconciler) Reconcile(ctx context.Context, _ reconcile.Request) (res reconcile.Result, err error) {
+func (r *reconciler) Reconcile(
+ ctx context.Context, _ reconcile.Request,
+) (res reconcile.Result, err error) {
ml := &mirrv1.ValdMirrorTargetList{}
err = r.mgr.GetClient().List(ctx, ml, r.lopts...)
if err != nil {
diff --git a/internal/log/glg/glg.go b/internal/log/glg/glg.go
index 8b5912ac3a..de0d6da925 100644
--- a/internal/log/glg/glg.go
+++ b/internal/log/glg/glg.go
@@ -89,15 +89,15 @@ func (*logger) Close() error {
return nil
}
-func (l *logger) Info(vals ...interface{}) {
+func (l *logger) Info(vals ...any) {
l.retry.Out(l.glg.Info, vals...)
}
-func (l *logger) Infof(format string, vals ...interface{}) {
+func (l *logger) Infof(format string, vals ...any) {
l.retry.Outf(l.glg.Infof, format, vals...)
}
-func (l *logger) Infod(msg string, details ...interface{}) {
+func (l *logger) Infod(msg string, details ...any) {
lf := l.glg.Infof
var dstr string
switch len(details) {
@@ -122,15 +122,15 @@ func (l *logger) Infod(msg string, details ...interface{}) {
l.retry.Outf(lf, detailsFormat, msg, dstr)
}
-func (l *logger) Debug(vals ...interface{}) {
+func (l *logger) Debug(vals ...any) {
l.retry.Out(l.glg.Debug, vals...)
}
-func (l *logger) Debugf(format string, vals ...interface{}) {
+func (l *logger) Debugf(format string, vals ...any) {
l.retry.Outf(l.glg.Debugf, format, vals...)
}
-func (l *logger) Debugd(msg string, details ...interface{}) {
+func (l *logger) Debugd(msg string, details ...any) {
lf := l.glg.Debugf
var dstr string
switch len(details) {
@@ -155,15 +155,15 @@ func (l *logger) Debugd(msg string, details ...interface{}) {
l.retry.Outf(lf, detailsFormat, msg, dstr)
}
-func (l *logger) Warn(vals ...interface{}) {
+func (l *logger) Warn(vals ...any) {
l.retry.Out(l.glg.Warn, vals...)
}
-func (l *logger) Warnf(format string, vals ...interface{}) {
+func (l *logger) Warnf(format string, vals ...any) {
l.retry.Outf(l.glg.Warnf, format, vals...)
}
-func (l *logger) Warnd(msg string, details ...interface{}) {
+func (l *logger) Warnd(msg string, details ...any) {
lf := l.glg.Warnf
var dstr string
switch len(details) {
@@ -188,15 +188,15 @@ func (l *logger) Warnd(msg string, details ...interface{}) {
l.retry.Outf(lf, detailsFormat, msg, dstr)
}
-func (l *logger) Error(vals ...interface{}) {
+func (l *logger) Error(vals ...any) {
l.retry.Out(l.glg.Error, vals...)
}
-func (l *logger) Errorf(format string, vals ...interface{}) {
+func (l *logger) Errorf(format string, vals ...any) {
l.retry.Outf(l.glg.Errorf, format, vals...)
}
-func (l *logger) Errord(msg string, details ...interface{}) {
+func (l *logger) Errord(msg string, details ...any) {
lf := l.glg.Errorf
var dstr string
switch len(details) {
@@ -221,15 +221,15 @@ func (l *logger) Errord(msg string, details ...interface{}) {
l.retry.Outf(lf, detailsFormat, msg, dstr)
}
-func (l *logger) Fatal(vals ...interface{}) {
+func (l *logger) Fatal(vals ...any) {
l.glg.SetCallerDepth(4).Fatal(vals...)
}
-func (l *logger) Fatalf(format string, vals ...interface{}) {
+func (l *logger) Fatalf(format string, vals ...any) {
l.glg.SetCallerDepth(4).Fatalf(format, vals...)
}
-func (l *logger) Fatald(msg string, details ...interface{}) {
+func (l *logger) Fatald(msg string, details ...any) {
var dstr string
switch len(details) {
case 0:
diff --git a/internal/log/glg/glg_test.go b/internal/log/glg/glg_test.go
index ddbd410284..0c1493bd40 100644
--- a/internal/log/glg/glg_test.go
+++ b/internal/log/glg/glg_test.go
@@ -334,7 +334,7 @@ func TestSetLogFormat(t *testing.T) {
got.glg.SetLevelWriter(glg.INFO, buf)
got.glg.Info("vald")
- var obj map[string]interface{}
+ var obj map[string]any
if err := json.NewDecoder(buf).Decode(&obj); err != nil {
return errors.New("not in JSON output logger")
}
@@ -355,7 +355,7 @@ func TestSetLogFormat(t *testing.T) {
got.glg.AddLevelWriter(glg.INFO, buf)
got.glg.Info("vald")
- var obj map[string]interface{}
+ var obj map[string]any
if err := json.NewDecoder(buf).Decode(&obj); err == nil {
return errors.New("not in RAW output logger")
}
@@ -379,7 +379,7 @@ func TestSetLogFormat(t *testing.T) {
func TestInfo(t *testing.T) {
type args struct {
- vals interface{}
+ vals any
}
type field struct {
@@ -398,7 +398,7 @@ func TestInfo(t *testing.T) {
func() test {
var gotVals string
retry := &mock.Retry{
- OutFunc: func(fn func(vals ...interface{}) error, vals ...interface{}) {
+ OutFunc: func(fn func(vals ...any) error, vals ...any) {
gotVals = vals[0].(string)
},
}
@@ -440,7 +440,7 @@ func TestInfo(t *testing.T) {
func TestInfof(t *testing.T) {
type args struct {
- vals interface{}
+ vals any
format string
}
@@ -463,7 +463,7 @@ func TestInfof(t *testing.T) {
gotFormat string
)
retry := &mock.Retry{
- OutfFunc: func(fn func(format string, vals ...interface{}) error, format string, vals ...interface{}) {
+ OutfFunc: func(fn func(format string, vals ...any) error, format string, vals ...any) {
gotFormat = format
gotVals = vals[0].(string)
},
@@ -512,7 +512,7 @@ func TestInfof(t *testing.T) {
func TestDebug(t *testing.T) {
type args struct {
- vals interface{}
+ vals any
}
type field struct {
@@ -531,7 +531,7 @@ func TestDebug(t *testing.T) {
func() test {
var gotVals string
retry := &mock.Retry{
- OutFunc: func(fn func(vals ...interface{}) error, vals ...interface{}) {
+ OutFunc: func(fn func(vals ...any) error, vals ...any) {
gotVals = vals[0].(string)
},
}
@@ -573,7 +573,7 @@ func TestDebug(t *testing.T) {
func TestDebugf(t *testing.T) {
type args struct {
- vals interface{}
+ vals any
format string
}
@@ -596,7 +596,7 @@ func TestDebugf(t *testing.T) {
gotFormat string
)
retry := &mock.Retry{
- OutfFunc: func(fn func(format string, vals ...interface{}) error, format string, vals ...interface{}) {
+ OutfFunc: func(fn func(format string, vals ...any) error, format string, vals ...any) {
gotFormat = format
gotVals = vals[0].(string)
},
@@ -645,7 +645,7 @@ func TestDebugf(t *testing.T) {
func TestWarn(t *testing.T) {
type args struct {
- vals interface{}
+ vals any
}
type field struct {
@@ -664,7 +664,7 @@ func TestWarn(t *testing.T) {
func() test {
var gotVals string
retry := &mock.Retry{
- OutFunc: func(fn func(vals ...interface{}) error, vals ...interface{}) {
+ OutFunc: func(fn func(vals ...any) error, vals ...any) {
gotVals = vals[0].(string)
},
}
@@ -706,7 +706,7 @@ func TestWarn(t *testing.T) {
func TestWarnf(t *testing.T) {
type args struct {
- vals interface{}
+ vals any
format string
}
@@ -729,7 +729,7 @@ func TestWarnf(t *testing.T) {
gotFormat string
)
retry := &mock.Retry{
- OutfFunc: func(fn func(format string, vals ...interface{}) error, format string, vals ...interface{}) {
+ OutfFunc: func(fn func(format string, vals ...any) error, format string, vals ...any) {
gotFormat = format
gotVals = vals[0].(string)
},
@@ -778,7 +778,7 @@ func TestWarnf(t *testing.T) {
func TestError(t *testing.T) {
type args struct {
- vals interface{}
+ vals any
}
type field struct {
@@ -797,7 +797,7 @@ func TestError(t *testing.T) {
func() test {
var gotVals string
retry := &mock.Retry{
- OutFunc: func(fn func(vals ...interface{}) error, vals ...interface{}) {
+ OutFunc: func(fn func(vals ...any) error, vals ...any) {
gotVals = vals[0].(string)
},
}
@@ -839,7 +839,7 @@ func TestError(t *testing.T) {
func TestErrorf(t *testing.T) {
type args struct {
- vals interface{}
+ vals any
format string
}
@@ -862,7 +862,7 @@ func TestErrorf(t *testing.T) {
gotFormat string
)
retry := &mock.Retry{
- OutfFunc: func(fn func(format string, vals ...interface{}) error, format string, vals ...interface{}) {
+ OutfFunc: func(fn func(format string, vals ...any) error, format string, vals ...any) {
gotFormat = format
gotVals = vals[0].(string)
},
@@ -1236,7 +1236,7 @@ func TestErrorf(t *testing.T) {
//
// func Test_logger_Info(t *testing.T) {
// type args struct {
-// vals []interface{}
+// vals []any
// }
// type fields struct {
// format format.Format
@@ -1343,7 +1343,7 @@ func TestErrorf(t *testing.T) {
// func Test_logger_Infof(t *testing.T) {
// type args struct {
// format string
-// vals []interface{}
+// vals []any
// }
// type fields struct {
// format format.Format
@@ -1452,7 +1452,7 @@ func TestErrorf(t *testing.T) {
// func Test_logger_Infod(t *testing.T) {
// type args struct {
// msg string
-// details []interface{}
+// details []any
// }
// type fields struct {
// format format.Format
@@ -1560,7 +1560,7 @@ func TestErrorf(t *testing.T) {
//
// func Test_logger_Debug(t *testing.T) {
// type args struct {
-// vals []interface{}
+// vals []any
// }
// type fields struct {
// format format.Format
@@ -1667,7 +1667,7 @@ func TestErrorf(t *testing.T) {
// func Test_logger_Debugf(t *testing.T) {
// type args struct {
// format string
-// vals []interface{}
+// vals []any
// }
// type fields struct {
// format format.Format
@@ -1776,7 +1776,7 @@ func TestErrorf(t *testing.T) {
// func Test_logger_Debugd(t *testing.T) {
// type args struct {
// msg string
-// details []interface{}
+// details []any
// }
// type fields struct {
// format format.Format
@@ -1884,7 +1884,7 @@ func TestErrorf(t *testing.T) {
//
// func Test_logger_Warn(t *testing.T) {
// type args struct {
-// vals []interface{}
+// vals []any
// }
// type fields struct {
// format format.Format
@@ -1991,7 +1991,7 @@ func TestErrorf(t *testing.T) {
// func Test_logger_Warnf(t *testing.T) {
// type args struct {
// format string
-// vals []interface{}
+// vals []any
// }
// type fields struct {
// format format.Format
@@ -2100,7 +2100,7 @@ func TestErrorf(t *testing.T) {
// func Test_logger_Warnd(t *testing.T) {
// type args struct {
// msg string
-// details []interface{}
+// details []any
// }
// type fields struct {
// format format.Format
@@ -2208,7 +2208,7 @@ func TestErrorf(t *testing.T) {
//
// func Test_logger_Error(t *testing.T) {
// type args struct {
-// vals []interface{}
+// vals []any
// }
// type fields struct {
// format format.Format
@@ -2315,7 +2315,7 @@ func TestErrorf(t *testing.T) {
// func Test_logger_Errorf(t *testing.T) {
// type args struct {
// format string
-// vals []interface{}
+// vals []any
// }
// type fields struct {
// format format.Format
@@ -2424,7 +2424,7 @@ func TestErrorf(t *testing.T) {
// func Test_logger_Errord(t *testing.T) {
// type args struct {
// msg string
-// details []interface{}
+// details []any
// }
// type fields struct {
// format format.Format
@@ -2532,7 +2532,7 @@ func TestErrorf(t *testing.T) {
//
// func Test_logger_Fatal(t *testing.T) {
// type args struct {
-// vals []interface{}
+// vals []any
// }
// type fields struct {
// format format.Format
@@ -2639,7 +2639,7 @@ func TestErrorf(t *testing.T) {
// func Test_logger_Fatalf(t *testing.T) {
// type args struct {
// format string
-// vals []interface{}
+// vals []any
// }
// type fields struct {
// format format.Format
@@ -2748,7 +2748,7 @@ func TestErrorf(t *testing.T) {
// func Test_logger_Fatald(t *testing.T) {
// type args struct {
// msg string
-// details []interface{}
+// details []any
// }
// type fields struct {
// format format.Format
diff --git a/internal/log/log.go b/internal/log/log.go
index 461c1f5f5b..b3ec1edc03 100644
--- a/internal/log/log.go
+++ b/internal/log/log.go
@@ -95,62 +95,62 @@ func Bold(str string) string {
return "\033[1m" + str + "\033[22m"
}
-func Debug(vals ...interface{}) {
+func Debug(vals ...any) {
l.Debug(vals...)
}
-func Debugf(format string, vals ...interface{}) {
+func Debugf(format string, vals ...any) {
l.Debugf(format, vals...)
}
-func Debugd(msg string, details ...interface{}) {
+func Debugd(msg string, details ...any) {
l.Debugd(msg, details...)
}
-func Info(vals ...interface{}) {
+func Info(vals ...any) {
l.Info(vals...)
}
-func Infof(format string, vals ...interface{}) {
+func Infof(format string, vals ...any) {
l.Infof(format, vals...)
}
-func Infod(msg string, details ...interface{}) {
+func Infod(msg string, details ...any) {
l.Infod(msg, details...)
}
-func Warn(vals ...interface{}) {
+func Warn(vals ...any) {
l.Warn(vals...)
}
-func Warnf(format string, vals ...interface{}) {
+func Warnf(format string, vals ...any) {
l.Warnf(format, vals...)
}
-func Warnd(msg string, details ...interface{}) {
+func Warnd(msg string, details ...any) {
l.Warnd(msg, details...)
}
-func Error(vals ...interface{}) {
+func Error(vals ...any) {
l.Error(vals...)
}
-func Errorf(format string, vals ...interface{}) {
+func Errorf(format string, vals ...any) {
l.Errorf(format, vals...)
}
-func Errord(msg string, details ...interface{}) {
+func Errord(msg string, details ...any) {
l.Errord(msg, details...)
}
-func Fatal(vals ...interface{}) {
+func Fatal(vals ...any) {
l.Fatal(vals...)
}
-func Fatalf(format string, vals ...interface{}) {
+func Fatalf(format string, vals ...any) {
l.Fatalf(format, vals...)
}
-func Fatald(msg string, details ...interface{}) {
+func Fatald(msg string, details ...any) {
l.Fatald(msg, details...)
}
diff --git a/internal/log/log_test.go b/internal/log/log_test.go
index d7ecbe6f8a..e6ffb8d901 100644
--- a/internal/log/log_test.go
+++ b/internal/log/log_test.go
@@ -288,10 +288,10 @@ func TestBold(t *testing.T) {
func TestDebug(t *testing.T) {
type args struct {
- vals []interface{}
+ vals []any
}
type want struct {
- vals []interface{}
+ vals []any
}
type test struct {
name string
@@ -303,16 +303,16 @@ func TestDebug(t *testing.T) {
}
tests := []test{
func() test {
- var got []interface{}
+ var got []any
ml := &mock.Logger{
- DebugFunc: func(vals ...interface{}) {
+ DebugFunc: func(vals ...any) {
got = vals
},
}
w := want{
- vals: []interface{}{
+ vals: []any{
"vald",
},
}
@@ -363,11 +363,11 @@ func TestDebug(t *testing.T) {
func TestDebugf(t *testing.T) {
type args struct {
format string
- vals []interface{}
+ vals []any
}
type want struct {
format string
- vals []interface{}
+ vals []any
}
type test struct {
name string
@@ -381,18 +381,18 @@ func TestDebugf(t *testing.T) {
func() test {
var (
gotFormat string
- gotVals []interface{}
+ gotVals []any
)
ml := &mock.Logger{
- DebugfFunc: func(format string, vals ...interface{}) {
+ DebugfFunc: func(format string, vals ...any) {
gotFormat, gotVals = format, vals
},
}
w := want{
format: "format",
- vals: []interface{}{
+ vals: []any{
"vald",
},
}
@@ -446,10 +446,10 @@ func TestDebugf(t *testing.T) {
func TestInfo(t *testing.T) {
type args struct {
- vals []interface{}
+ vals []any
}
type want struct {
- vals []interface{}
+ vals []any
}
type test struct {
name string
@@ -461,16 +461,16 @@ func TestInfo(t *testing.T) {
}
tests := []test{
func() test {
- var got []interface{}
+ var got []any
ml := &mock.Logger{
- InfoFunc: func(vals ...interface{}) {
+ InfoFunc: func(vals ...any) {
got = vals
},
}
w := want{
- vals: []interface{}{
+ vals: []any{
"vald",
},
}
@@ -521,11 +521,11 @@ func TestInfo(t *testing.T) {
func TestInfof(t *testing.T) {
type args struct {
format string
- vals []interface{}
+ vals []any
}
type want struct {
format string
- vals []interface{}
+ vals []any
}
type test struct {
name string
@@ -539,18 +539,18 @@ func TestInfof(t *testing.T) {
func() test {
var (
gotFormat string
- gotVals []interface{}
+ gotVals []any
)
ml := &mock.Logger{
- InfofFunc: func(format string, vals ...interface{}) {
+ InfofFunc: func(format string, vals ...any) {
gotFormat, gotVals = format, vals
},
}
w := want{
format: "format",
- vals: []interface{}{
+ vals: []any{
"vald",
},
}
@@ -604,10 +604,10 @@ func TestInfof(t *testing.T) {
func TestWarn(t *testing.T) {
type args struct {
- vals []interface{}
+ vals []any
}
type want struct {
- vals []interface{}
+ vals []any
}
type test struct {
name string
@@ -619,16 +619,16 @@ func TestWarn(t *testing.T) {
}
tests := []test{
func() test {
- var got []interface{}
+ var got []any
ml := &mock.Logger{
- WarnFunc: func(vals ...interface{}) {
+ WarnFunc: func(vals ...any) {
got = vals
},
}
w := want{
- vals: []interface{}{
+ vals: []any{
"vald",
},
}
@@ -679,11 +679,11 @@ func TestWarn(t *testing.T) {
func TestWarnf(t *testing.T) {
type args struct {
format string
- vals []interface{}
+ vals []any
}
type want struct {
format string
- vals []interface{}
+ vals []any
}
type test struct {
name string
@@ -697,18 +697,18 @@ func TestWarnf(t *testing.T) {
func() test {
var (
gotFormat string
- gotVals []interface{}
+ gotVals []any
)
ml := &mock.Logger{
- WarnfFunc: func(format string, vals ...interface{}) {
+ WarnfFunc: func(format string, vals ...any) {
gotFormat, gotVals = format, vals
},
}
w := want{
format: "format",
- vals: []interface{}{
+ vals: []any{
"vald",
},
}
@@ -762,10 +762,10 @@ func TestWarnf(t *testing.T) {
func TestError(t *testing.T) {
type args struct {
- vals []interface{}
+ vals []any
}
type want struct {
- vals []interface{}
+ vals []any
}
type test struct {
name string
@@ -777,16 +777,16 @@ func TestError(t *testing.T) {
}
tests := []test{
func() test {
- var got []interface{}
+ var got []any
ml := &mock.Logger{
- ErrorFunc: func(vals ...interface{}) {
+ ErrorFunc: func(vals ...any) {
got = vals
},
}
w := want{
- vals: []interface{}{
+ vals: []any{
"vald",
},
}
@@ -837,11 +837,11 @@ func TestError(t *testing.T) {
func TestErrorf(t *testing.T) {
type args struct {
format string
- vals []interface{}
+ vals []any
}
type want struct {
format string
- vals []interface{}
+ vals []any
}
type test struct {
name string
@@ -855,18 +855,18 @@ func TestErrorf(t *testing.T) {
func() test {
var (
gotFormat string
- gotVals []interface{}
+ gotVals []any
)
ml := &mock.Logger{
- ErrorfFunc: func(format string, vals ...interface{}) {
+ ErrorfFunc: func(format string, vals ...any) {
gotFormat, gotVals = format, vals
},
}
w := want{
format: "format",
- vals: []interface{}{
+ vals: []any{
"vald",
},
}
@@ -920,10 +920,10 @@ func TestErrorf(t *testing.T) {
func TestFatal(t *testing.T) {
type args struct {
- vals []interface{}
+ vals []any
}
type want struct {
- vals []interface{}
+ vals []any
}
type test struct {
name string
@@ -935,16 +935,16 @@ func TestFatal(t *testing.T) {
}
tests := []test{
func() test {
- var got []interface{}
+ var got []any
ml := &mock.Logger{
- FatalFunc: func(vals ...interface{}) {
+ FatalFunc: func(vals ...any) {
got = vals
},
}
w := want{
- vals: []interface{}{
+ vals: []any{
"vald",
},
}
@@ -995,11 +995,11 @@ func TestFatal(t *testing.T) {
func TestFatalf(t *testing.T) {
type args struct {
format string
- vals []interface{}
+ vals []any
}
type want struct {
format string
- vals []interface{}
+ vals []any
}
type test struct {
name string
@@ -1013,18 +1013,18 @@ func TestFatalf(t *testing.T) {
func() test {
var (
gotFormat string
- gotVals []interface{}
+ gotVals []any
)
ml := &mock.Logger{
- FatalfFunc: func(format string, vals ...interface{}) {
+ FatalfFunc: func(format string, vals ...any) {
gotFormat, gotVals = format, vals
},
}
w := want{
format: "format",
- vals: []interface{}{
+ vals: []any{
"vald",
},
}
@@ -1157,7 +1157,7 @@ func TestFatalf(t *testing.T) {
// func TestDebugd(t *testing.T) {
// type args struct {
// msg string
-// details []interface{}
+// details []any
// }
// type want struct {
// }
@@ -1241,7 +1241,7 @@ func TestFatalf(t *testing.T) {
// func TestInfod(t *testing.T) {
// type args struct {
// msg string
-// details []interface{}
+// details []any
// }
// type want struct {
// }
@@ -1325,7 +1325,7 @@ func TestFatalf(t *testing.T) {
// func TestWarnd(t *testing.T) {
// type args struct {
// msg string
-// details []interface{}
+// details []any
// }
// type want struct {
// }
@@ -1409,7 +1409,7 @@ func TestFatalf(t *testing.T) {
// func TestErrord(t *testing.T) {
// type args struct {
// msg string
-// details []interface{}
+// details []any
// }
// type want struct {
// }
@@ -1493,7 +1493,7 @@ func TestFatalf(t *testing.T) {
// func TestFatald(t *testing.T) {
// type args struct {
// msg string
-// details []interface{}
+// details []any
// }
// type want struct {
// }
diff --git a/internal/log/logger/iface.go b/internal/log/logger/iface.go
index b34290d8ab..b14bf0237c 100644
--- a/internal/log/logger/iface.go
+++ b/internal/log/logger/iface.go
@@ -18,49 +18,49 @@ package logger
type Logger interface {
// Debug logs the vals at Debug level.
- Debug(vals ...interface{})
+ Debug(vals ...any)
// Debugf logs the formatted message at Debug level.
- Debugf(format string, vals ...interface{})
+ Debugf(format string, vals ...any)
// Debugd logs the message with details at Debug level.
- Debugd(msg string, details ...interface{})
+ Debugd(msg string, details ...any)
// Info logs the vals at Info level.
- Info(vals ...interface{})
+ Info(vals ...any)
// Infof logs the formatted message at Info level.
- Infof(format string, vals ...interface{})
+ Infof(format string, vals ...any)
// Infod logs the message with details at Info level.
- Infod(msg string, details ...interface{})
+ Infod(msg string, details ...any)
// Warn logs the vals at Warn level.
- Warn(vals ...interface{})
+ Warn(vals ...any)
// Warnf logs the formatted message at Warn level.
- Warnf(format string, vals ...interface{})
+ Warnf(format string, vals ...any)
// Warnd logs the message with details at Warn level.
- Warnd(msg string, details ...interface{})
+ Warnd(msg string, details ...any)
// Error logs the vals at Error level.
- Error(vals ...interface{})
+ Error(vals ...any)
// Errorf logs the formatted message at Error level.
- Errorf(format string, vals ...interface{})
+ Errorf(format string, vals ...any)
// Errord logs the message with details at Error level.
- Errord(msg string, details ...interface{})
+ Errord(msg string, details ...any)
// Fatal logs the vals at Fatal level, then calls os.Exit(1).
- Fatal(vals ...interface{})
+ Fatal(vals ...any)
// Fatalf logs the formatted message at Fatal level, then calls os.Exit(1).
- Fatalf(format string, vals ...interface{})
+ Fatalf(format string, vals ...any)
// Fatald logs the message with details at Fatal level, then calls os.Exit(1).
- Fatald(msg string, details ...interface{})
+ Fatald(msg string, details ...any)
// Close calls finalizer of logger implementations.
Close() error
diff --git a/internal/log/mock/logger.go b/internal/log/mock/logger.go
index 7c5f15ec07..2d205461ab 100644
--- a/internal/log/mock/logger.go
+++ b/internal/log/mock/logger.go
@@ -15,90 +15,90 @@ package mock
// Logger represents struct of each log level function.
type Logger struct {
- DebugFunc func(vals ...interface{})
- DebugfFunc func(format string, vals ...interface{})
- InfoFunc func(vals ...interface{})
- InfofFunc func(format string, vals ...interface{})
- WarnFunc func(vals ...interface{})
- WarnfFunc func(format string, vals ...interface{})
- ErrorFunc func(vals ...interface{})
- ErrorfFunc func(format string, vals ...interface{})
- FatalFunc func(vals ...interface{})
- FatalfFunc func(format string, vals ...interface{})
+ DebugFunc func(vals ...any)
+ DebugfFunc func(format string, vals ...any)
+ InfoFunc func(vals ...any)
+ InfofFunc func(format string, vals ...any)
+ WarnFunc func(vals ...any)
+ WarnfFunc func(format string, vals ...any)
+ ErrorFunc func(vals ...any)
+ ErrorfFunc func(format string, vals ...any)
+ FatalFunc func(vals ...any)
+ FatalfFunc func(format string, vals ...any)
}
// Debug calls DebugFunc of Logger.
-func (l *Logger) Debug(vals ...interface{}) {
+func (l *Logger) Debug(vals ...any) {
l.DebugFunc(vals...)
}
// Debugf calls DebugfFunc of Logger.
-func (l *Logger) Debugf(format string, vals ...interface{}) {
+func (l *Logger) Debugf(format string, vals ...any) {
l.DebugfFunc(format, vals...)
}
// Debugd calls DebugfFunc of Logger.
-func (l *Logger) Debugd(msg string, details ...interface{}) {
+func (l *Logger) Debugd(msg string, details ...any) {
l.DebugfFunc(msg, details...)
}
// Info calls InfoFunc of Logger.
-func (l *Logger) Info(vals ...interface{}) {
+func (l *Logger) Info(vals ...any) {
l.InfoFunc(vals...)
}
// Infof calls InfofFunc of Logger.
-func (l *Logger) Infof(format string, vals ...interface{}) {
+func (l *Logger) Infof(format string, vals ...any) {
l.InfofFunc(format, vals...)
}
// Infod calls InfofFunc of Logger.
-func (l *Logger) Infod(msg string, details ...interface{}) {
+func (l *Logger) Infod(msg string, details ...any) {
l.InfofFunc(msg, details...)
}
// Warn calls WarnFunc of Logger.
-func (l *Logger) Warn(vals ...interface{}) {
+func (l *Logger) Warn(vals ...any) {
l.WarnFunc(vals...)
}
// Warnf calls WarnfFunc of Logger.
-func (l *Logger) Warnf(format string, vals ...interface{}) {
+func (l *Logger) Warnf(format string, vals ...any) {
l.WarnfFunc(format, vals...)
}
// Warnd calls WarnfFunc of Logger.
-func (l *Logger) Warnd(msg string, details ...interface{}) {
+func (l *Logger) Warnd(msg string, details ...any) {
l.WarnfFunc(msg, details...)
}
// Error calls ErrorFunc of Logger.
-func (l *Logger) Error(vals ...interface{}) {
+func (l *Logger) Error(vals ...any) {
l.ErrorFunc(vals...)
}
// Errorf calls ErrorfFunc of Logger.
-func (l *Logger) Errorf(format string, vals ...interface{}) {
+func (l *Logger) Errorf(format string, vals ...any) {
l.ErrorfFunc(format, vals...)
}
// Errord calls ErrorfFunc of Logger.
-func (l *Logger) Errord(msg string, details ...interface{}) {
+func (l *Logger) Errord(msg string, details ...any) {
l.ErrorfFunc(msg, details...)
}
// Fatal calls FatalFunc of Logger.
-func (l *Logger) Fatal(vals ...interface{}) {
+func (l *Logger) Fatal(vals ...any) {
l.FatalFunc(vals...)
}
// Fatalf calls FatalfFunc of Logger.
-func (l *Logger) Fatalf(format string, vals ...interface{}) {
+func (l *Logger) Fatalf(format string, vals ...any) {
l.FatalfFunc(format, vals...)
}
// Fatald calls FatalfFunc of Logger.
-func (l *Logger) Fatald(msg string, details ...interface{}) {
+func (l *Logger) Fatald(msg string, details ...any) {
l.FatalfFunc(msg, details...)
}
diff --git a/internal/log/mock/logger_test.go b/internal/log/mock/logger_test.go
index 5f30169ea1..06f83867d4 100644
--- a/internal/log/mock/logger_test.go
+++ b/internal/log/mock/logger_test.go
@@ -23,10 +23,10 @@ import (
func TestLogger_Debug(t *testing.T) {
type args struct {
- vals []interface{}
+ vals []any
}
type fields struct {
- DebugFunc func(vals ...interface{})
+ DebugFunc func(vals ...any)
}
type want struct{}
type test struct {
@@ -43,7 +43,7 @@ func TestLogger_Debug(t *testing.T) {
}
tests := []test{
func() test {
- wantVals := []interface{}{
+ wantVals := []any{
"Vald",
}
var cnt int
@@ -55,7 +55,7 @@ func TestLogger_Debug(t *testing.T) {
fieldsFunc: func(t *testing.T) fields {
t.Helper()
return fields{
- DebugFunc: func(vals ...interface{}) {
+ DebugFunc: func(vals ...any) {
if !reflect.DeepEqual(vals, wantVals) {
t.Errorf("got = %v, want = %v", vals, wantVals)
}
@@ -103,10 +103,10 @@ func TestLogger_Debug(t *testing.T) {
func TestLogger_Debugf(t *testing.T) {
type args struct {
format string
- vals []interface{}
+ vals []any
}
type fields struct {
- DebugfFunc func(format string, vals ...interface{})
+ DebugfFunc func(format string, vals ...any)
}
type want struct{}
type test struct {
@@ -123,7 +123,7 @@ func TestLogger_Debugf(t *testing.T) {
}
tests := []test{
func() test {
- wantVals := []interface{}{
+ wantVals := []any{
"Vald",
}
wantFormat := "json"
@@ -137,7 +137,7 @@ func TestLogger_Debugf(t *testing.T) {
fieldsFunc: func(t *testing.T) fields {
t.Helper()
return fields{
- DebugfFunc: func(format string, vals ...interface{}) {
+ DebugfFunc: func(format string, vals ...any) {
if !reflect.DeepEqual(vals, wantVals) || !reflect.DeepEqual(format, wantFormat) {
t.Errorf("got = %v, want = %v", vals, wantVals)
}
@@ -184,10 +184,10 @@ func TestLogger_Debugf(t *testing.T) {
func TestLogger_Info(t *testing.T) {
type args struct {
- vals []interface{}
+ vals []any
}
type fields struct {
- InfoFunc func(vals ...interface{})
+ InfoFunc func(vals ...any)
}
type want struct{}
type test struct {
@@ -204,7 +204,7 @@ func TestLogger_Info(t *testing.T) {
}
tests := []test{
func() test {
- wantVals := []interface{}{
+ wantVals := []any{
"Vald",
}
var cnt int
@@ -216,7 +216,7 @@ func TestLogger_Info(t *testing.T) {
fieldsFunc: func(t *testing.T) fields {
t.Helper()
return fields{
- InfoFunc: func(vals ...interface{}) {
+ InfoFunc: func(vals ...any) {
if !reflect.DeepEqual(vals, wantVals) {
t.Errorf("got = %v, want = %v", vals, wantVals)
}
@@ -264,10 +264,10 @@ func TestLogger_Info(t *testing.T) {
func TestLogger_Infof(t *testing.T) {
type args struct {
format string
- vals []interface{}
+ vals []any
}
type fields struct {
- InfofFunc func(format string, vals ...interface{})
+ InfofFunc func(format string, vals ...any)
}
type want struct{}
type test struct {
@@ -284,7 +284,7 @@ func TestLogger_Infof(t *testing.T) {
}
tests := []test{
func() test {
- wantVals := []interface{}{
+ wantVals := []any{
"Vald",
}
wantFormat := "json"
@@ -298,7 +298,7 @@ func TestLogger_Infof(t *testing.T) {
fieldsFunc: func(t *testing.T) fields {
t.Helper()
return fields{
- InfofFunc: func(format string, vals ...interface{}) {
+ InfofFunc: func(format string, vals ...any) {
if !reflect.DeepEqual(vals, wantVals) || !reflect.DeepEqual(format, wantFormat) {
t.Errorf("got = %v, want = %v", vals, wantVals)
}
@@ -345,10 +345,10 @@ func TestLogger_Infof(t *testing.T) {
func TestLogger_Warn(t *testing.T) {
type args struct {
- vals []interface{}
+ vals []any
}
type fields struct {
- WarnFunc func(vals ...interface{})
+ WarnFunc func(vals ...any)
}
type want struct{}
type test struct {
@@ -365,7 +365,7 @@ func TestLogger_Warn(t *testing.T) {
}
tests := []test{
func() test {
- wantVals := []interface{}{
+ wantVals := []any{
"Vald",
}
var cnt int
@@ -377,7 +377,7 @@ func TestLogger_Warn(t *testing.T) {
fieldsFunc: func(t *testing.T) fields {
t.Helper()
return fields{
- WarnFunc: func(vals ...interface{}) {
+ WarnFunc: func(vals ...any) {
if !reflect.DeepEqual(vals, wantVals) {
t.Errorf("got = %v, want = %v", vals, wantVals)
}
@@ -425,10 +425,10 @@ func TestLogger_Warn(t *testing.T) {
func TestLogger_Warnf(t *testing.T) {
type args struct {
format string
- vals []interface{}
+ vals []any
}
type fields struct {
- WarnfFunc func(format string, vals ...interface{})
+ WarnfFunc func(format string, vals ...any)
}
type want struct{}
type test struct {
@@ -445,7 +445,7 @@ func TestLogger_Warnf(t *testing.T) {
}
tests := []test{
func() test {
- wantVals := []interface{}{
+ wantVals := []any{
"Vald",
}
wantFormat := "json"
@@ -459,7 +459,7 @@ func TestLogger_Warnf(t *testing.T) {
fieldsFunc: func(t *testing.T) fields {
t.Helper()
return fields{
- WarnfFunc: func(format string, vals ...interface{}) {
+ WarnfFunc: func(format string, vals ...any) {
if !reflect.DeepEqual(vals, wantVals) || !reflect.DeepEqual(format, wantFormat) {
t.Errorf("got = %v, want = %v", vals, wantVals)
}
@@ -506,10 +506,10 @@ func TestLogger_Warnf(t *testing.T) {
func TestLogger_Error(t *testing.T) {
type args struct {
- vals []interface{}
+ vals []any
}
type fields struct {
- ErrorFunc func(vals ...interface{})
+ ErrorFunc func(vals ...any)
}
type want struct{}
type test struct {
@@ -526,7 +526,7 @@ func TestLogger_Error(t *testing.T) {
}
tests := []test{
func() test {
- wantVals := []interface{}{
+ wantVals := []any{
"Vald",
}
var cnt int
@@ -538,7 +538,7 @@ func TestLogger_Error(t *testing.T) {
fieldsFunc: func(t *testing.T) fields {
t.Helper()
return fields{
- ErrorFunc: func(vals ...interface{}) {
+ ErrorFunc: func(vals ...any) {
if !reflect.DeepEqual(vals, wantVals) {
t.Errorf("got = %v, want = %v", vals, wantVals)
}
@@ -586,10 +586,10 @@ func TestLogger_Error(t *testing.T) {
func TestLogger_Errorf(t *testing.T) {
type args struct {
format string
- vals []interface{}
+ vals []any
}
type fields struct {
- ErrorfFunc func(format string, vals ...interface{})
+ ErrorfFunc func(format string, vals ...any)
}
type want struct{}
type test struct {
@@ -606,7 +606,7 @@ func TestLogger_Errorf(t *testing.T) {
}
tests := []test{
func() test {
- wantVals := []interface{}{
+ wantVals := []any{
"Vald",
}
wantFormat := "json"
@@ -620,7 +620,7 @@ func TestLogger_Errorf(t *testing.T) {
fieldsFunc: func(t *testing.T) fields {
t.Helper()
return fields{
- ErrorfFunc: func(format string, vals ...interface{}) {
+ ErrorfFunc: func(format string, vals ...any) {
if !reflect.DeepEqual(vals, wantVals) || !reflect.DeepEqual(format, wantFormat) {
t.Errorf("got = %v, want = %v", vals, wantVals)
}
@@ -667,10 +667,10 @@ func TestLogger_Errorf(t *testing.T) {
func TestLogger_Fatal(t *testing.T) {
type args struct {
- vals []interface{}
+ vals []any
}
type fields struct {
- FatalFunc func(vals ...interface{})
+ FatalFunc func(vals ...any)
}
type want struct{}
type test struct {
@@ -687,7 +687,7 @@ func TestLogger_Fatal(t *testing.T) {
}
tests := []test{
func() test {
- wantVals := []interface{}{
+ wantVals := []any{
"Vald",
}
var cnt int
@@ -699,7 +699,7 @@ func TestLogger_Fatal(t *testing.T) {
fieldsFunc: func(t *testing.T) fields {
t.Helper()
return fields{
- FatalFunc: func(vals ...interface{}) {
+ FatalFunc: func(vals ...any) {
if !reflect.DeepEqual(vals, wantVals) {
t.Errorf("got = %v, want = %v", vals, wantVals)
}
@@ -747,10 +747,10 @@ func TestLogger_Fatal(t *testing.T) {
func TestLogger_Fatalf(t *testing.T) {
type args struct {
format string
- vals []interface{}
+ vals []any
}
type fields struct {
- FatalfFunc func(format string, vals ...interface{})
+ FatalfFunc func(format string, vals ...any)
}
type want struct{}
type test struct {
@@ -767,7 +767,7 @@ func TestLogger_Fatalf(t *testing.T) {
}
tests := []test{
func() test {
- wantVals := []interface{}{
+ wantVals := []any{
"Vald",
}
wantFormat := "json"
@@ -781,7 +781,7 @@ func TestLogger_Fatalf(t *testing.T) {
fieldsFunc: func(t *testing.T) fields {
t.Helper()
return fields{
- FatalfFunc: func(format string, vals ...interface{}) {
+ FatalfFunc: func(format string, vals ...any) {
if !reflect.DeepEqual(vals, wantVals) || !reflect.DeepEqual(format, wantFormat) {
t.Errorf("got = %v, want = %v", vals, wantVals)
}
@@ -831,19 +831,19 @@ func TestLogger_Fatalf(t *testing.T) {
// func TestLogger_Debugd(t *testing.T) {
// type args struct {
// msg string
-// details []interface{}
+// details []any
// }
// type fields struct {
-// DebugFunc func(vals ...interface{})
-// DebugfFunc func(format string, vals ...interface{})
-// InfoFunc func(vals ...interface{})
-// InfofFunc func(format string, vals ...interface{})
-// WarnFunc func(vals ...interface{})
-// WarnfFunc func(format string, vals ...interface{})
-// ErrorFunc func(vals ...interface{})
-// ErrorfFunc func(format string, vals ...interface{})
-// FatalFunc func(vals ...interface{})
-// FatalfFunc func(format string, vals ...interface{})
+// DebugFunc func(vals ...any)
+// DebugfFunc func(format string, vals ...any)
+// InfoFunc func(vals ...any)
+// InfofFunc func(format string, vals ...any)
+// WarnFunc func(vals ...any)
+// WarnfFunc func(format string, vals ...any)
+// ErrorFunc func(vals ...any)
+// ErrorfFunc func(format string, vals ...any)
+// FatalFunc func(vals ...any)
+// FatalfFunc func(format string, vals ...any)
// }
// type want struct {
// }
@@ -964,19 +964,19 @@ func TestLogger_Fatalf(t *testing.T) {
// func TestLogger_Infod(t *testing.T) {
// type args struct {
// msg string
-// details []interface{}
+// details []any
// }
// type fields struct {
-// DebugFunc func(vals ...interface{})
-// DebugfFunc func(format string, vals ...interface{})
-// InfoFunc func(vals ...interface{})
-// InfofFunc func(format string, vals ...interface{})
-// WarnFunc func(vals ...interface{})
-// WarnfFunc func(format string, vals ...interface{})
-// ErrorFunc func(vals ...interface{})
-// ErrorfFunc func(format string, vals ...interface{})
-// FatalFunc func(vals ...interface{})
-// FatalfFunc func(format string, vals ...interface{})
+// DebugFunc func(vals ...any)
+// DebugfFunc func(format string, vals ...any)
+// InfoFunc func(vals ...any)
+// InfofFunc func(format string, vals ...any)
+// WarnFunc func(vals ...any)
+// WarnfFunc func(format string, vals ...any)
+// ErrorFunc func(vals ...any)
+// ErrorfFunc func(format string, vals ...any)
+// FatalFunc func(vals ...any)
+// FatalfFunc func(format string, vals ...any)
// }
// type want struct {
// }
@@ -1097,19 +1097,19 @@ func TestLogger_Fatalf(t *testing.T) {
// func TestLogger_Warnd(t *testing.T) {
// type args struct {
// msg string
-// details []interface{}
+// details []any
// }
// type fields struct {
-// DebugFunc func(vals ...interface{})
-// DebugfFunc func(format string, vals ...interface{})
-// InfoFunc func(vals ...interface{})
-// InfofFunc func(format string, vals ...interface{})
-// WarnFunc func(vals ...interface{})
-// WarnfFunc func(format string, vals ...interface{})
-// ErrorFunc func(vals ...interface{})
-// ErrorfFunc func(format string, vals ...interface{})
-// FatalFunc func(vals ...interface{})
-// FatalfFunc func(format string, vals ...interface{})
+// DebugFunc func(vals ...any)
+// DebugfFunc func(format string, vals ...any)
+// InfoFunc func(vals ...any)
+// InfofFunc func(format string, vals ...any)
+// WarnFunc func(vals ...any)
+// WarnfFunc func(format string, vals ...any)
+// ErrorFunc func(vals ...any)
+// ErrorfFunc func(format string, vals ...any)
+// FatalFunc func(vals ...any)
+// FatalfFunc func(format string, vals ...any)
// }
// type want struct {
// }
@@ -1230,19 +1230,19 @@ func TestLogger_Fatalf(t *testing.T) {
// func TestLogger_Errord(t *testing.T) {
// type args struct {
// msg string
-// details []interface{}
+// details []any
// }
// type fields struct {
-// DebugFunc func(vals ...interface{})
-// DebugfFunc func(format string, vals ...interface{})
-// InfoFunc func(vals ...interface{})
-// InfofFunc func(format string, vals ...interface{})
-// WarnFunc func(vals ...interface{})
-// WarnfFunc func(format string, vals ...interface{})
-// ErrorFunc func(vals ...interface{})
-// ErrorfFunc func(format string, vals ...interface{})
-// FatalFunc func(vals ...interface{})
-// FatalfFunc func(format string, vals ...interface{})
+// DebugFunc func(vals ...any)
+// DebugfFunc func(format string, vals ...any)
+// InfoFunc func(vals ...any)
+// InfofFunc func(format string, vals ...any)
+// WarnFunc func(vals ...any)
+// WarnfFunc func(format string, vals ...any)
+// ErrorFunc func(vals ...any)
+// ErrorfFunc func(format string, vals ...any)
+// FatalFunc func(vals ...any)
+// FatalfFunc func(format string, vals ...any)
// }
// type want struct {
// }
@@ -1363,19 +1363,19 @@ func TestLogger_Fatalf(t *testing.T) {
// func TestLogger_Fatald(t *testing.T) {
// type args struct {
// msg string
-// details []interface{}
+// details []any
// }
// type fields struct {
-// DebugFunc func(vals ...interface{})
-// DebugfFunc func(format string, vals ...interface{})
-// InfoFunc func(vals ...interface{})
-// InfofFunc func(format string, vals ...interface{})
-// WarnFunc func(vals ...interface{})
-// WarnfFunc func(format string, vals ...interface{})
-// ErrorFunc func(vals ...interface{})
-// ErrorfFunc func(format string, vals ...interface{})
-// FatalFunc func(vals ...interface{})
-// FatalfFunc func(format string, vals ...interface{})
+// DebugFunc func(vals ...any)
+// DebugfFunc func(format string, vals ...any)
+// InfoFunc func(vals ...any)
+// InfofFunc func(format string, vals ...any)
+// WarnFunc func(vals ...any)
+// WarnfFunc func(format string, vals ...any)
+// ErrorFunc func(vals ...any)
+// ErrorfFunc func(format string, vals ...any)
+// FatalFunc func(vals ...any)
+// FatalfFunc func(format string, vals ...any)
// }
// type want struct {
// }
@@ -1495,16 +1495,16 @@ func TestLogger_Fatalf(t *testing.T) {
//
// func TestLogger_Close(t *testing.T) {
// type fields struct {
-// DebugFunc func(vals ...interface{})
-// DebugfFunc func(format string, vals ...interface{})
-// InfoFunc func(vals ...interface{})
-// InfofFunc func(format string, vals ...interface{})
-// WarnFunc func(vals ...interface{})
-// WarnfFunc func(format string, vals ...interface{})
-// ErrorFunc func(vals ...interface{})
-// ErrorfFunc func(format string, vals ...interface{})
-// FatalFunc func(vals ...interface{})
-// FatalfFunc func(format string, vals ...interface{})
+// DebugFunc func(vals ...any)
+// DebugfFunc func(format string, vals ...any)
+// InfoFunc func(vals ...any)
+// InfofFunc func(format string, vals ...any)
+// WarnFunc func(vals ...any)
+// WarnfFunc func(format string, vals ...any)
+// ErrorFunc func(vals ...any)
+// ErrorfFunc func(format string, vals ...any)
+// FatalFunc func(vals ...any)
+// FatalfFunc func(format string, vals ...any)
// }
// type want struct {
// err error
diff --git a/internal/log/mock/retry.go b/internal/log/mock/retry.go
index dc7fac6ee8..edc39ce74d 100644
--- a/internal/log/mock/retry.go
+++ b/internal/log/mock/retry.go
@@ -16,29 +16,23 @@ package mock
// Retry represents struct of mock retry structure.
type Retry struct {
OutFunc func(
- fn func(vals ...interface{}) error,
- vals ...interface{},
+ fn func(vals ...any) error,
+ vals ...any,
)
OutfFunc func(
- fn func(format string, vals ...interface{}) error,
+ fn func(format string, vals ...any) error,
format string,
- vals ...interface{},
+ vals ...any,
)
}
// Out calls OutFunc.
-func (r *Retry) Out(
- fn func(vals ...interface{}) error,
- vals ...interface{},
-) {
+func (r *Retry) Out(fn func(vals ...any) error, vals ...any) {
r.OutFunc(fn, vals...)
}
// Outf calls OutfFunc.
-func (r *Retry) Outf(
- fn func(format string, vals ...interface{}) error,
- format string, vals ...interface{},
-) {
+func (r *Retry) Outf(fn func(format string, vals ...any) error, format string, vals ...any) {
r.OutfFunc(fn, format, vals...)
}
diff --git a/internal/log/mock/retry_test.go b/internal/log/mock/retry_test.go
index f9fa60f34b..fed2b59adf 100644
--- a/internal/log/mock/retry_test.go
+++ b/internal/log/mock/retry_test.go
@@ -23,11 +23,11 @@ import (
func TestRetry_Out(t *testing.T) {
type args struct {
- fn func(vals ...interface{}) error
- vals []interface{}
+ fn func(vals ...any) error
+ vals []any
}
type fields struct {
- OutFunc func(fn func(vals ...interface{}) error, vals ...interface{})
+ OutFunc func(fn func(vals ...any) error, vals ...any)
}
type want struct{}
type test struct {
@@ -45,10 +45,10 @@ func TestRetry_Out(t *testing.T) {
tests := []test{
func() test {
var (
- wantFn = func(vals ...interface{}) error {
+ wantFn = func(vals ...any) error {
return nil
}
- wantVals = []interface{}{
+ wantVals = []any{
"Vald",
}
cnt int
@@ -62,7 +62,7 @@ func TestRetry_Out(t *testing.T) {
fieldsFunc: func(t *testing.T) fields {
t.Helper()
return fields{
- OutFunc: func(fn func(vals ...interface{}) error, vals ...interface{}) {
+ OutFunc: func(fn func(vals ...any) error, vals ...any) {
if !reflect.DeepEqual(vals, wantVals) {
t.Errorf("vals got = %v, want = %v", vals, wantVals)
}
@@ -112,12 +112,12 @@ func TestRetry_Out(t *testing.T) {
func TestRetry_Outf(t *testing.T) {
type args struct {
- fn func(format string, vals ...interface{}) error
+ fn func(format string, vals ...any) error
format string
- vals []interface{}
+ vals []any
}
type fields struct {
- OutfFunc func(fn func(format string, vals ...interface{}) error, format string, vals ...interface{})
+ OutfFunc func(fn func(format string, vals ...any) error, format string, vals ...any)
}
type want struct{}
type test struct {
@@ -135,10 +135,10 @@ func TestRetry_Outf(t *testing.T) {
tests := []test{
func() test {
var (
- wantFn = func(format string, vals ...interface{}) error {
+ wantFn = func(format string, vals ...any) error {
return nil
}
- wantVals = []interface{}{
+ wantVals = []any{
"Vald",
}
wantFormat = "json"
@@ -154,7 +154,7 @@ func TestRetry_Outf(t *testing.T) {
fieldsFunc: func(t *testing.T) fields {
t.Helper()
return fields{
- OutfFunc: func(fn func(format string, vals ...interface{}) error, format string, vals ...interface{}) {
+ OutfFunc: func(fn func(format string, vals ...any) error, format string, vals ...any) {
if !reflect.DeepEqual(vals, wantVals) {
t.Errorf("vals got = %v, want = %v", vals, wantVals)
}
diff --git a/internal/log/nop/nop.go b/internal/log/nop/nop.go
index d84600504c..c9fa659ca3 100644
--- a/internal/log/nop/nop.go
+++ b/internal/log/nop/nop.go
@@ -13,9 +13,7 @@
// limitations under the License.
package nop
-import (
- "github.com/vdaas/vald/internal/log/logger"
-)
+import "github.com/vdaas/vald/internal/log/logger"
type nopLogger struct{}
@@ -25,49 +23,49 @@ func New() logger.Logger {
}
// Debug logs the vals at Debug level.
-func (*nopLogger) Debug(...interface{}) {}
+func (*nopLogger) Debug(...any) {}
// Debugf logs the formatted message at Debug level.
-func (*nopLogger) Debugf(string, ...interface{}) {}
+func (*nopLogger) Debugf(string, ...any) {}
// Debugd logs the message with details at Debug level.
-func (*nopLogger) Debugd(string, ...interface{}) {}
+func (*nopLogger) Debugd(string, ...any) {}
// Info logs the vals at Info level.
-func (*nopLogger) Info(...interface{}) {}
+func (*nopLogger) Info(...any) {}
// Infof logs the formatted message at Info level.
-func (*nopLogger) Infof(string, ...interface{}) {}
+func (*nopLogger) Infof(string, ...any) {}
// Infod logs the message with details at Info level.
-func (*nopLogger) Infod(string, ...interface{}) {}
+func (*nopLogger) Infod(string, ...any) {}
// Warn logs the vals at Warn level.
-func (*nopLogger) Warn(...interface{}) {}
+func (*nopLogger) Warn(...any) {}
// Warnf logs the formatted message at Warn level.
-func (*nopLogger) Warnf(string, ...interface{}) {}
+func (*nopLogger) Warnf(string, ...any) {}
// Warnd logs the message with details at Warn level.
-func (*nopLogger) Warnd(string, ...interface{}) {}
+func (*nopLogger) Warnd(string, ...any) {}
// Error logs the vals at Error level.
-func (*nopLogger) Error(...interface{}) {}
+func (*nopLogger) Error(...any) {}
// Errorf logs the formatted message at Error level.
-func (*nopLogger) Errorf(string, ...interface{}) {}
+func (*nopLogger) Errorf(string, ...any) {}
// Errord logs the message with details at Error level.
-func (*nopLogger) Errord(string, ...interface{}) {}
+func (*nopLogger) Errord(string, ...any) {}
// Fatal logs the vals at Fatal level, then calls os.Exit(1).
-func (*nopLogger) Fatal(...interface{}) {}
+func (*nopLogger) Fatal(...any) {}
// Fatalf logs the formatted message at Fatal level, then calls os.Exit(1).
-func (*nopLogger) Fatalf(string, ...interface{}) {}
+func (*nopLogger) Fatalf(string, ...any) {}
// Fatald logs the message with details at Fatal level, then calls os.Exit(1).
-func (*nopLogger) Fatald(string, ...interface{}) {}
+func (*nopLogger) Fatald(string, ...any) {}
// Close calls finalizer of logger implementations.
func (*nopLogger) Close() error {
diff --git a/internal/log/nop/nop_test.go b/internal/log/nop/nop_test.go
index 89a723d037..e731e8ea09 100644
--- a/internal/log/nop/nop_test.go
+++ b/internal/log/nop/nop_test.go
@@ -76,7 +76,7 @@ func TestNew(t *testing.T) {
func Test_nopLogger_Debug(t *testing.T) {
t.Parallel()
type args struct {
- vals []interface{}
+ vals []any
}
type want struct{}
type test struct {
@@ -126,7 +126,7 @@ func Test_nopLogger_Debugf(t *testing.T) {
t.Parallel()
type args struct {
format string
- vals []interface{}
+ vals []any
}
type want struct{}
type test struct {
@@ -176,7 +176,7 @@ func Test_nopLogger_Debugd(t *testing.T) {
t.Parallel()
type args struct {
msg string
- details []interface{}
+ details []any
}
type want struct{}
type test struct {
@@ -225,7 +225,7 @@ func Test_nopLogger_Debugd(t *testing.T) {
func Test_nopLogger_Info(t *testing.T) {
t.Parallel()
type args struct {
- vals []interface{}
+ vals []any
}
type want struct{}
type test struct {
@@ -275,7 +275,7 @@ func Test_nopLogger_Infof(t *testing.T) {
t.Parallel()
type args struct {
format string
- vals []interface{}
+ vals []any
}
type want struct{}
type test struct {
@@ -325,7 +325,7 @@ func Test_nopLogger_Infod(t *testing.T) {
t.Parallel()
type args struct {
msg string
- details []interface{}
+ details []any
}
type want struct{}
type test struct {
@@ -374,7 +374,7 @@ func Test_nopLogger_Infod(t *testing.T) {
func Test_nopLogger_Warn(t *testing.T) {
t.Parallel()
type args struct {
- vals []interface{}
+ vals []any
}
type want struct{}
type test struct {
@@ -424,7 +424,7 @@ func Test_nopLogger_Warnf(t *testing.T) {
t.Parallel()
type args struct {
format string
- vals []interface{}
+ vals []any
}
type want struct{}
type test struct {
@@ -474,7 +474,7 @@ func Test_nopLogger_Warnd(t *testing.T) {
t.Parallel()
type args struct {
msg string
- details []interface{}
+ details []any
}
type want struct{}
type test struct {
@@ -523,7 +523,7 @@ func Test_nopLogger_Warnd(t *testing.T) {
func Test_nopLogger_Error(t *testing.T) {
t.Parallel()
type args struct {
- vals []interface{}
+ vals []any
}
type want struct{}
type test struct {
@@ -573,7 +573,7 @@ func Test_nopLogger_Errorf(t *testing.T) {
t.Parallel()
type args struct {
format string
- vals []interface{}
+ vals []any
}
type want struct{}
type test struct {
@@ -623,7 +623,7 @@ func Test_nopLogger_Errord(t *testing.T) {
t.Parallel()
type args struct {
msg string
- details []interface{}
+ details []any
}
type want struct{}
type test struct {
@@ -672,7 +672,7 @@ func Test_nopLogger_Errord(t *testing.T) {
func Test_nopLogger_Fatal(t *testing.T) {
t.Parallel()
type args struct {
- vals []interface{}
+ vals []any
}
type want struct{}
type test struct {
@@ -722,7 +722,7 @@ func Test_nopLogger_Fatalf(t *testing.T) {
t.Parallel()
type args struct {
format string
- vals []interface{}
+ vals []any
}
type want struct{}
type test struct {
@@ -772,7 +772,7 @@ func Test_nopLogger_Fatald(t *testing.T) {
t.Parallel()
type args struct {
msg string
- details []interface{}
+ details []any
}
type want struct{}
type test struct {
diff --git a/internal/log/retry/option.go b/internal/log/retry/option.go
index b627b00b9c..d90d2c7018 100644
--- a/internal/log/retry/option.go
+++ b/internal/log/retry/option.go
@@ -21,10 +21,10 @@ var (
WithWarn(nopFunc),
}
- nopFunc = func(vals ...interface{}) {}
+ nopFunc = func(vals ...any) {}
)
-func WithError(fn func(vals ...interface{})) Option {
+func WithError(fn func(vals ...any)) Option {
return func(r *retry) {
if fn == nil {
return
@@ -33,7 +33,7 @@ func WithError(fn func(vals ...interface{})) Option {
}
}
-func WithWarn(fn func(vals ...interface{})) Option {
+func WithWarn(fn func(vals ...any)) Option {
return func(r *retry) {
if fn == nil {
return
diff --git a/internal/log/retry/option_test.go b/internal/log/retry/option_test.go
index 702df02427..004e860442 100644
--- a/internal/log/retry/option_test.go
+++ b/internal/log/retry/option_test.go
@@ -24,7 +24,7 @@ import (
func TestWithError(t *testing.T) {
type T = retry
type args struct {
- fn func(vals ...interface{})
+ fn func(vals ...any)
}
type want struct {
obj *T
@@ -47,7 +47,7 @@ func TestWithError(t *testing.T) {
tests := []test{
func() test {
- fn := func(vals ...interface{}) {}
+ fn := func(vals ...any) {}
return test{
name: "set success when fn is not nil",
args: args{
@@ -98,7 +98,7 @@ func TestWithError(t *testing.T) {
func TestWithWarn(t *testing.T) {
type T = retry
type args struct {
- fn func(vals ...interface{})
+ fn func(vals ...any)
}
type want struct {
obj *T
@@ -121,7 +121,7 @@ func TestWithWarn(t *testing.T) {
tests := []test{
func() test {
- fn := func(vals ...interface{}) {}
+ fn := func(vals ...any) {}
return test{
name: "set success when fn is not nil",
args: args{
diff --git a/internal/log/retry/retry.go b/internal/log/retry/retry.go
index f64ad0fb1d..fdc0db9698 100644
--- a/internal/log/retry/retry.go
+++ b/internal/log/retry/retry.go
@@ -21,18 +21,18 @@ import (
type Retry interface {
Out(
- fn func(vals ...interface{}) error,
- vals ...interface{},
+ fn func(vals ...any) error,
+ vals ...any,
)
Outf(
- fn func(format string, vals ...interface{}) error,
- format string, vals ...interface{},
+ fn func(format string, vals ...any) error,
+ format string, vals ...any,
)
}
type retry struct {
- warnFn func(vals ...interface{})
- errorFn func(vals ...interface{})
+ warnFn func(vals ...any)
+ errorFn func(vals ...any)
}
func New(opts ...Option) Retry {
@@ -43,10 +43,7 @@ func New(opts ...Option) Retry {
return r
}
-func (r *retry) Out(
- fn func(vals ...interface{}) error,
- vals ...interface{},
-) {
+func (r *retry) Out(fn func(vals ...any) error, vals ...any) {
if fn != nil {
if err := fn(vals...); err != nil {
rv := reflect.ValueOf(fn)
@@ -63,10 +60,7 @@ func (r *retry) Out(
}
}
-func (r *retry) Outf(
- fn func(format string, vals ...interface{}) error,
- format string, vals ...interface{},
-) {
+func (r *retry) Outf(fn func(format string, vals ...any) error, format string, vals ...any) {
if fn != nil {
if err := fn(format, vals...); err != nil {
rv := reflect.ValueOf(fn)
diff --git a/internal/log/retry/retry_test.go b/internal/log/retry/retry_test.go
index 12e564d05d..d8c9d8432d 100644
--- a/internal/log/retry/retry_test.go
+++ b/internal/log/retry/retry_test.go
@@ -61,7 +61,7 @@ func TestNew(t *testing.T) {
},
func() test {
- fn := func(...interface{}) {}
+ fn := func(...any) {}
return test{
name: "returns l when opts is not nil",
args: args{
@@ -104,12 +104,12 @@ func TestNew(t *testing.T) {
func Test_retry_Out(t *testing.T) {
type args struct {
- fn func(vals ...interface{}) error
- vals []interface{}
+ fn func(vals ...any) error
+ vals []any
}
type fields struct {
- warnFn func(vals ...interface{})
- errorFn func(vals ...interface{})
+ warnFn func(vals ...any)
+ errorFn func(vals ...any)
}
type test struct {
name string
@@ -129,7 +129,7 @@ func Test_retry_Out(t *testing.T) {
gotCnt = 0
)
- fn := func(vals ...interface{}) error {
+ fn := func(vals ...any) error {
gotCnt++
return nil
}
@@ -150,7 +150,7 @@ func Test_retry_Out(t *testing.T) {
func() test {
err := errors.New("error")
- fn := func(vals ...interface{}) error {
+ fn := func(vals ...any) error {
return err
}
@@ -159,13 +159,13 @@ func Test_retry_Out(t *testing.T) {
gotErrorFnErr error
)
- warnFn := func(vals ...interface{}) {
+ warnFn := func(vals ...any) {
if len(vals) == 1 {
gotWarnFnErr = vals[0].(error)
}
}
- errorFn := func(vals ...interface{}) {
+ errorFn := func(vals ...any) {
if len(vals) == 1 {
gotErrorFnErr = vals[0].(error)
}
@@ -230,13 +230,13 @@ func Test_retry_Out(t *testing.T) {
func Test_retry_Outf(t *testing.T) {
type args struct {
- fn func(format string, vals ...interface{}) error
+ fn func(format string, vals ...any) error
format string
- vals []interface{}
+ vals []any
}
type fields struct {
- warnFn func(vals ...interface{})
- errorFn func(vals ...interface{})
+ warnFn func(vals ...any)
+ errorFn func(vals ...any)
}
type test struct {
name string
@@ -254,7 +254,7 @@ func Test_retry_Outf(t *testing.T) {
var (
wantCnt = 1
wantFormat = "foramt"
- wantVals = []interface{}{
+ wantVals = []any{
"vald",
}
)
@@ -262,10 +262,10 @@ func Test_retry_Outf(t *testing.T) {
var (
gotCnt int
gotFormat string
- gotVals []interface{}
+ gotVals []any
)
- fn := func(format string, vals ...interface{}) error {
+ fn := func(format string, vals ...any) error {
gotCnt++
gotFormat = format
gotVals = vals
@@ -299,7 +299,7 @@ func Test_retry_Outf(t *testing.T) {
func() test {
err := errors.New("error")
- fn := func(format string, vals ...interface{}) error {
+ fn := func(format string, vals ...any) error {
return err
}
@@ -308,13 +308,13 @@ func Test_retry_Outf(t *testing.T) {
gotErrorFnErr error
)
- warnFn := func(vals ...interface{}) {
+ warnFn := func(vals ...any) {
if len(vals) == 1 {
gotWarnFnErr = vals[0].(error)
}
}
- errorFn := func(vals ...interface{}) {
+ errorFn := func(vals ...any) {
if len(vals) == 1 {
gotErrorFnErr = vals[0].(error)
}
diff --git a/internal/log/zap/zap.go b/internal/log/zap/zap.go
index 796bb67014..615499b869 100644
--- a/internal/log/zap/zap.go
+++ b/internal/log/zap/zap.go
@@ -134,15 +134,15 @@ func toZapEncoder(fmt format.Format) zapcore.Encoder {
}
}
-func (l *logger) Debug(vals ...interface{}) {
+func (l *logger) Debug(vals ...any) {
l.sugar.Debug(vals...)
}
-func (l *logger) Debugf(format string, vals ...interface{}) {
+func (l *logger) Debugf(format string, vals ...any) {
l.sugar.Debugf(format, vals...)
}
-func (l *logger) Debugd(msg string, details ...interface{}) {
+func (l *logger) Debugd(msg string, details ...any) {
if len(details) == 1 {
l.logger.Debug(msg, zap.Any(detailsKey, details[0]))
return
@@ -151,15 +151,15 @@ func (l *logger) Debugd(msg string, details ...interface{}) {
l.logger.Debug(msg, zap.Any(detailsKey, details))
}
-func (l *logger) Info(vals ...interface{}) {
+func (l *logger) Info(vals ...any) {
l.sugar.Info(vals...)
}
-func (l *logger) Infof(format string, vals ...interface{}) {
+func (l *logger) Infof(format string, vals ...any) {
l.sugar.Infof(format, vals...)
}
-func (l *logger) Infod(msg string, details ...interface{}) {
+func (l *logger) Infod(msg string, details ...any) {
if len(details) == 1 {
l.logger.Info(msg, zap.Any(detailsKey, details[0]))
return
@@ -168,15 +168,15 @@ func (l *logger) Infod(msg string, details ...interface{}) {
l.logger.Info(msg, zap.Any(detailsKey, details))
}
-func (l *logger) Warn(vals ...interface{}) {
+func (l *logger) Warn(vals ...any) {
l.sugar.Warn(vals...)
}
-func (l *logger) Warnf(format string, vals ...interface{}) {
+func (l *logger) Warnf(format string, vals ...any) {
l.sugar.Warnf(format, vals...)
}
-func (l *logger) Warnd(msg string, details ...interface{}) {
+func (l *logger) Warnd(msg string, details ...any) {
if len(details) == 1 {
l.logger.Warn(msg, zap.Any(detailsKey, details[0]))
return
@@ -185,15 +185,15 @@ func (l *logger) Warnd(msg string, details ...interface{}) {
l.logger.Warn(msg, zap.Any(detailsKey, details))
}
-func (l *logger) Error(vals ...interface{}) {
+func (l *logger) Error(vals ...any) {
l.sugar.Error(vals...)
}
-func (l *logger) Errorf(format string, vals ...interface{}) {
+func (l *logger) Errorf(format string, vals ...any) {
l.sugar.Errorf(format, vals...)
}
-func (l *logger) Errord(msg string, details ...interface{}) {
+func (l *logger) Errord(msg string, details ...any) {
if len(details) == 1 {
l.logger.Error(msg, zap.Any(detailsKey, details[0]))
return
@@ -202,15 +202,15 @@ func (l *logger) Errord(msg string, details ...interface{}) {
l.logger.Error(msg, zap.Any(detailsKey, details))
}
-func (l *logger) Fatal(vals ...interface{}) {
+func (l *logger) Fatal(vals ...any) {
l.sugar.Fatal(vals...)
}
-func (l *logger) Fatalf(format string, vals ...interface{}) {
+func (l *logger) Fatalf(format string, vals ...any) {
l.sugar.Fatalf(format, vals...)
}
-func (l *logger) Fatald(msg string, details ...interface{}) {
+func (l *logger) Fatald(msg string, details ...any) {
if len(details) == 1 {
l.logger.Fatal(msg, zap.Any(detailsKey, details[0]))
return
diff --git a/internal/log/zap/zap_test.go b/internal/log/zap/zap_test.go
index c073d75b8b..bc40f04833 100644
--- a/internal/log/zap/zap_test.go
+++ b/internal/log/zap/zap_test.go
@@ -469,7 +469,7 @@ func Test_toZapEncoder(t *testing.T) {
func Test_logger_Debug(t *testing.T) {
type args struct {
- vals []interface{}
+ vals []any
}
type fields struct {
format format.Format
@@ -495,7 +495,7 @@ func Test_logger_Debug(t *testing.T) {
{
name: "just call Debug",
args: args{
- vals: []interface{}{"value"},
+ vals: []any{"value"},
},
fields: fields{
format: format.RAW,
@@ -542,7 +542,7 @@ func Test_logger_Debug(t *testing.T) {
func Test_logger_Debugf(t *testing.T) {
type args struct {
format string
- vals []interface{}
+ vals []any
}
type fields struct {
format format.Format
@@ -569,7 +569,7 @@ func Test_logger_Debugf(t *testing.T) {
name: "just call Debugf",
args: args{
format: "%s",
- vals: []interface{}{"value"},
+ vals: []any{"value"},
},
fields: fields{
format: format.RAW,
@@ -615,7 +615,7 @@ func Test_logger_Debugf(t *testing.T) {
func Test_logger_Info(t *testing.T) {
type args struct {
- vals []interface{}
+ vals []any
}
type fields struct {
format format.Format
@@ -641,7 +641,7 @@ func Test_logger_Info(t *testing.T) {
{
name: "just call Info",
args: args{
- vals: []interface{}{"value"},
+ vals: []any{"value"},
},
fields: fields{
format: format.RAW,
@@ -688,7 +688,7 @@ func Test_logger_Info(t *testing.T) {
func Test_logger_Infof(t *testing.T) {
type args struct {
format string
- vals []interface{}
+ vals []any
}
type fields struct {
format format.Format
@@ -715,7 +715,7 @@ func Test_logger_Infof(t *testing.T) {
name: "just call Infof",
args: args{
format: "%s",
- vals: []interface{}{"value"},
+ vals: []any{"value"},
},
fields: fields{
format: format.RAW,
@@ -761,7 +761,7 @@ func Test_logger_Infof(t *testing.T) {
func Test_logger_Warn(t *testing.T) {
type args struct {
- vals []interface{}
+ vals []any
}
type fields struct {
format format.Format
@@ -787,7 +787,7 @@ func Test_logger_Warn(t *testing.T) {
{
name: "just call Warn",
args: args{
- vals: []interface{}{"value"},
+ vals: []any{"value"},
},
fields: fields{
format: format.RAW,
@@ -834,7 +834,7 @@ func Test_logger_Warn(t *testing.T) {
func Test_logger_Warnf(t *testing.T) {
type args struct {
format string
- vals []interface{}
+ vals []any
}
type fields struct {
format format.Format
@@ -861,7 +861,7 @@ func Test_logger_Warnf(t *testing.T) {
name: "just call Warnf",
args: args{
format: "%s",
- vals: []interface{}{"value"},
+ vals: []any{"value"},
},
fields: fields{
format: format.RAW,
@@ -907,7 +907,7 @@ func Test_logger_Warnf(t *testing.T) {
func Test_logger_Error(t *testing.T) {
type args struct {
- vals []interface{}
+ vals []any
}
type fields struct {
format format.Format
@@ -933,7 +933,7 @@ func Test_logger_Error(t *testing.T) {
{
name: "just call Error",
args: args{
- vals: []interface{}{"value"},
+ vals: []any{"value"},
},
fields: fields{
format: format.RAW,
@@ -980,7 +980,7 @@ func Test_logger_Error(t *testing.T) {
func Test_logger_Errorf(t *testing.T) {
type args struct {
format string
- vals []interface{}
+ vals []any
}
type fields struct {
format format.Format
@@ -1007,7 +1007,7 @@ func Test_logger_Errorf(t *testing.T) {
name: "just call Errorf",
args: args{
format: "%s",
- vals: []interface{}{"value"},
+ vals: []any{"value"},
},
fields: fields{
format: format.RAW,
@@ -1053,7 +1053,7 @@ func Test_logger_Errorf(t *testing.T) {
func Test_logger_Fatal(t *testing.T) {
type args struct {
- vals []interface{}
+ vals []any
}
type fields struct {
format format.Format
@@ -1079,7 +1079,7 @@ func Test_logger_Fatal(t *testing.T) {
// {
// name: "just call Fatal",
// args: args{
- // vals: []interface{}{"value"},
+ // vals: []any{"value"},
// },
// fields: fields{
// format: format.RAW,
@@ -1128,7 +1128,7 @@ func Test_logger_Fatal(t *testing.T) {
func Test_logger_Fatalf(t *testing.T) {
type args struct {
format string
- vals []interface{}
+ vals []any
}
type fields struct {
format format.Format
@@ -1155,7 +1155,7 @@ func Test_logger_Fatalf(t *testing.T) {
// name: "just call Fatalf",
// args: args{
// format: "%s",
- // vals: []interface{}{"value"},
+ // vals: []any{"value"},
// },
// fields: fields{
// format: format.RAW,
@@ -1205,7 +1205,7 @@ func Test_logger_Debugd(t *testing.T) {
t.Parallel()
type args struct {
msg string
- details []interface{}
+ details []any
}
type fields struct {
format format.Format
@@ -1232,7 +1232,7 @@ func Test_logger_Debugd(t *testing.T) {
name: "just call Debugd",
args: args{
msg: "message",
- details: []interface{}{"detail"},
+ details: []any{"detail"},
},
fields: fields{
format: format.RAW,
@@ -1248,7 +1248,7 @@ func Test_logger_Debugd(t *testing.T) {
name: "call Debugd with two details",
args: args{
msg: "message",
- details: []interface{}{
+ details: []any{
"detail1",
"detail2",
},
@@ -1300,7 +1300,7 @@ func Test_logger_Infod(t *testing.T) {
t.Parallel()
type args struct {
msg string
- details []interface{}
+ details []any
}
type fields struct {
format format.Format
@@ -1327,7 +1327,7 @@ func Test_logger_Infod(t *testing.T) {
name: "just call Infod",
args: args{
msg: "message",
- details: []interface{}{"detail"},
+ details: []any{"detail"},
},
fields: fields{
format: format.RAW,
@@ -1343,7 +1343,7 @@ func Test_logger_Infod(t *testing.T) {
name: "call Infod with two details",
args: args{
msg: "message",
- details: []interface{}{
+ details: []any{
"detail1",
"detail2",
},
@@ -1395,7 +1395,7 @@ func Test_logger_Warnd(t *testing.T) {
t.Parallel()
type args struct {
msg string
- details []interface{}
+ details []any
}
type fields struct {
format format.Format
@@ -1422,7 +1422,7 @@ func Test_logger_Warnd(t *testing.T) {
name: "just call Warnd",
args: args{
msg: "message",
- details: []interface{}{"detail"},
+ details: []any{"detail"},
},
fields: fields{
format: format.RAW,
@@ -1438,7 +1438,7 @@ func Test_logger_Warnd(t *testing.T) {
name: "call Warnd with two details",
args: args{
msg: "message",
- details: []interface{}{
+ details: []any{
"detail1",
"detail2",
},
@@ -1490,7 +1490,7 @@ func Test_logger_Errord(t *testing.T) {
t.Parallel()
type args struct {
msg string
- details []interface{}
+ details []any
}
type fields struct {
format format.Format
@@ -1517,7 +1517,7 @@ func Test_logger_Errord(t *testing.T) {
name: "just call Errord",
args: args{
msg: "message",
- details: []interface{}{"detail"},
+ details: []any{"detail"},
},
fields: fields{
format: format.RAW,
@@ -1533,7 +1533,7 @@ func Test_logger_Errord(t *testing.T) {
name: "call Errord with two details",
args: args{
msg: "message",
- details: []interface{}{
+ details: []any{
"detail1",
"detail2",
},
@@ -1585,7 +1585,7 @@ func Test_logger_Fatald(t *testing.T) {
t.Parallel()
type args struct {
msg string
- details []interface{}
+ details []any
}
type fields struct {
format format.Format
@@ -1612,7 +1612,7 @@ func Test_logger_Fatald(t *testing.T) {
// name: "just call Fatald",
// args: args{
// msg: "message",
- // details: []interface{}{"detail"},
+ // details: []any{"detail"},
// },
// fields: fields{
// format: format.RAW,
@@ -1628,7 +1628,7 @@ func Test_logger_Fatald(t *testing.T) {
// name: "call Fatald with two details",
// args: args{
// msg: "message",
- // details: []interface{}{
+ // details: []any{
// "detail1",
// "detail2",
// },
diff --git a/internal/net/control/control_unix.go b/internal/net/control/control_unix.go
index 28ab6f2843..f49cf4ef21 100644
--- a/internal/net/control/control_unix.go
+++ b/internal/net/control/control_unix.go
@@ -19,9 +19,7 @@
// Package control provides network socket option
package control
-import (
- "golang.org/x/sys/unix"
-)
+import "golang.org/x/sys/unix"
var SetsockoptInt = unix.SetsockoptInt
diff --git a/internal/net/control/control_windows.go b/internal/net/control/control_windows.go
index 33a7818059..bc0d9a23c2 100644
--- a/internal/net/control/control_windows.go
+++ b/internal/net/control/control_windows.go
@@ -19,9 +19,7 @@
// Package control provides network socket option
package control
-import (
- "golang.org/x/sys/windows"
-)
+import "golang.org/x/sys/windows"
var SetsockoptInt = func(fd, level, opt int, value int) (err error) {
if level == windows.SOL_SOCKET && opt == windows.SO_REUSEADDR {
diff --git a/internal/net/dialer.go b/internal/net/dialer.go
index ff6571043a..8eda81e568 100644
--- a/internal/net/dialer.go
+++ b/internal/net/dialer.go
@@ -336,7 +336,9 @@ func (d *dialer) dial(ctx context.Context, network, addr string) (conn Conn, err
return conn, nil
}
-func (d *dialer) tlsHandshake(ctx context.Context, conn Conn, network, addr string) (tconn *tls.Conn, err error) {
+func (d *dialer) tlsHandshake(
+ ctx context.Context, conn Conn, network, addr string,
+) (tconn *tls.Conn, err error) {
ctx, span := trace.StartSpan(ctx, apiName+"/Dialer.tlsHandshake")
defer func() {
if span != nil {
diff --git a/internal/net/grpc/admin/admin.go b/internal/net/grpc/admin/admin.go
index 66e320bc1b..1380b08479 100644
--- a/internal/net/grpc/admin/admin.go
+++ b/internal/net/grpc/admin/admin.go
@@ -17,8 +17,6 @@
// Package admin provides grpc admin metrics registration API for providing grpc metrics endpoints
package admin
-import (
- "google.golang.org/grpc/admin"
-)
+import "google.golang.org/grpc/admin"
var Register = admin.Register
diff --git a/internal/net/grpc/client.go b/internal/net/grpc/client.go
index 291a8c0c83..b6a4f3eceb 100644
--- a/internal/net/grpc/client.go
+++ b/internal/net/grpc/client.go
@@ -80,10 +80,10 @@ type Client interface {
Do(ctx context.Context, addr string,
f func(ctx context.Context,
conn *ClientConn,
- copts ...CallOption) (interface{}, error)) (interface{}, error)
+ copts ...CallOption) (any, error)) (any, error)
RoundRobin(ctx context.Context, f func(ctx context.Context,
conn *ClientConn,
- copts ...CallOption) (interface{}, error)) (interface{}, error)
+ copts ...CallOption) (any, error)) (any, error)
GetDialOption() []DialOption
GetCallOption() []CallOption
GetBackoff() backoff.Backoff
@@ -342,7 +342,7 @@ func (g *gRPCClient) StartConnectionMonitor(ctx context.Context) (<-chan error,
var p pool.Conn
if enabled && g.bo != nil {
- _, err = g.bo.Do(clctx, func(ictx context.Context) (r interface{}, ret bool, err error) {
+ _, err = g.bo.Do(clctx, func(ictx context.Context) (r any, ret bool, err error) {
p, err = g.Connect(ictx, addr)
return nil, err != nil, err
})
@@ -399,7 +399,8 @@ func (g *gRPCClient) StartConnectionMonitor(ctx context.Context) (<-chan error,
return ech, nil
}
-func (g *gRPCClient) Range(ctx context.Context,
+func (g *gRPCClient) Range(
+ ctx context.Context,
f func(ctx context.Context, addr string, conn *ClientConn, copts ...CallOption) error,
) (err error) {
sctx, span := trace.StartSpan(ctx, apiName+"/Client.Range")
@@ -423,7 +424,7 @@ func (g *gRPCClient) Range(ctx context.Context,
return false
default:
_, err := g.connectWithBackoff(ssctx, p, addr, true, func(ictx context.Context, conn *ClientConn, copts ...CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
return nil, f(ictx, addr, conn, copts...)
})
if err != nil {
@@ -455,8 +456,10 @@ func (g *gRPCClient) Range(ctx context.Context,
return nil
}
-func (g *gRPCClient) RangeConcurrent(ctx context.Context,
- concurrency int, f func(ctx context.Context, addr string, conn *ClientConn, copts ...CallOption) error,
+func (g *gRPCClient) RangeConcurrent(
+ ctx context.Context,
+ concurrency int,
+ f func(ctx context.Context, addr string, conn *ClientConn, copts ...CallOption) error,
) (err error) {
sctx, span := trace.StartSpan(ctx, apiName+"/Client.RangeConcurrent")
defer func() {
@@ -491,7 +494,7 @@ func (g *gRPCClient) RangeConcurrent(ctx context.Context,
default:
_, err = g.connectWithBackoff(ssctx, p, addr, true, func(ictx context.Context,
conn *ClientConn, copts ...CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
err := f(ictx, addr, conn, copts...)
return nil, err
})
@@ -534,8 +537,10 @@ func (g *gRPCClient) RangeConcurrent(ctx context.Context,
return nil
}
-func (g *gRPCClient) OrderedRange(ctx context.Context,
- orders []string, f func(ctx context.Context, addr string, conn *ClientConn, copts ...CallOption) error,
+func (g *gRPCClient) OrderedRange(
+ ctx context.Context,
+ orders []string,
+ f func(ctx context.Context, addr string, conn *ClientConn, copts ...CallOption) error,
) (err error) {
sctx, span := trace.StartSpan(ctx, apiName+"/Client.OrderedRange")
defer func() {
@@ -571,7 +576,7 @@ func (g *gRPCClient) OrderedRange(ctx context.Context,
}()
_, ierr := g.connectWithBackoff(ssctx, p, addr, true, func(ictx context.Context,
conn *ClientConn, copts ...CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
return nil, f(ictx, addr, conn, copts...)
})
if ierr != nil {
@@ -598,8 +603,11 @@ func (g *gRPCClient) OrderedRange(ctx context.Context,
return nil
}
-func (g *gRPCClient) OrderedRangeConcurrent(ctx context.Context,
- orders []string, concurrency int, f func(ctx context.Context, addr string, conn *ClientConn, copts ...CallOption) error,
+func (g *gRPCClient) OrderedRangeConcurrent(
+ ctx context.Context,
+ orders []string,
+ concurrency int,
+ f func(ctx context.Context, addr string, conn *ClientConn, copts ...CallOption) error,
) (err error) {
sctx, span := trace.StartSpan(ctx, apiName+"/Client.OrderedRangeConcurrent")
defer func() {
@@ -640,7 +648,7 @@ func (g *gRPCClient) OrderedRangeConcurrent(ctx context.Context,
default:
_, err = g.connectWithBackoff(ssctx, p, addr, true, func(ictx context.Context,
conn *ClientConn, copts ...CallOption,
- ) (interface{}, error) {
+ ) (any, error) {
return nil, f(ictx, addr, conn, copts...)
})
if err != nil {
@@ -669,9 +677,11 @@ func (g *gRPCClient) OrderedRangeConcurrent(ctx context.Context,
return nil
}
-func (g *gRPCClient) RoundRobin(ctx context.Context, f func(ctx context.Context,
- conn *ClientConn, copts ...CallOption) (interface{}, error),
-) (data interface{}, err error) {
+func (g *gRPCClient) RoundRobin(
+ ctx context.Context,
+ f func(ctx context.Context,
+ conn *ClientConn, copts ...CallOption) (any, error),
+) (data any, err error) {
sctx, span := trace.StartSpan(ctx, apiName+"/Client.RoundRobin")
defer func() {
if span != nil {
@@ -687,7 +697,7 @@ func (g *gRPCClient) RoundRobin(ctx context.Context, f func(ctx context.Context,
sctx = backoff.WithBackoffName(sctx, boName)
}
- do := func() (data interface{}, err error) {
+ do := func() (data any, err error) {
cerr := g.rangeConns(func(addr string, p pool.Conn) bool {
select {
case <-ctx.Done():
@@ -707,7 +717,7 @@ func (g *gRPCClient) RoundRobin(ctx context.Context, f func(ctx context.Context,
ctx = backoff.WithBackoffName(ctx, boName)
}
if g.cb != nil && len(boName) > 0 {
- data, err = g.cb.Do(ctx, boName, func(ictx context.Context) (interface{}, error) {
+ data, err = g.cb.Do(ctx, boName, func(ictx context.Context) (any, error) {
return g.connectWithBackoff(ictx, p, addr, false, f)
})
if err != nil {
@@ -748,7 +758,7 @@ func (g *gRPCClient) RoundRobin(ctx context.Context, f func(ctx context.Context,
}
if g.bo != nil {
- return g.bo.Do(sctx, func(ictx context.Context) (r interface{}, ret bool, err error) {
+ return g.bo.Do(sctx, func(ictx context.Context) (r any, ret bool, err error) {
r, err = do()
if err != nil {
if errors.Is(err, context.Canceled) ||
@@ -781,10 +791,12 @@ func (g *gRPCClient) RoundRobin(ctx context.Context, f func(ctx context.Context,
return do()
}
-func (g *gRPCClient) Do(ctx context.Context, addr string,
+func (g *gRPCClient) Do(
+ ctx context.Context,
+ addr string,
f func(ctx context.Context,
- conn *ClientConn, copts ...CallOption) (interface{}, error),
-) (data interface{}, err error) {
+ conn *ClientConn, copts ...CallOption) (any, error),
+) (data any, err error) {
sctx, span := trace.StartSpan(ctx, apiName+"/Client.Do/"+addr)
defer func() {
if span != nil {
@@ -815,10 +827,14 @@ func (g *gRPCClient) Do(ctx context.Context, addr string,
return data, err
}
-func (g *gRPCClient) connectWithBackoff(ctx context.Context, p pool.Conn, addr string, enableBackoff bool,
+func (g *gRPCClient) connectWithBackoff(
+ ctx context.Context,
+ p pool.Conn,
+ addr string,
+ enableBackoff bool,
f func(ctx context.Context,
- conn *ClientConn, copts ...CallOption) (interface{}, error),
-) (data interface{}, err error) {
+ conn *ClientConn, copts ...CallOption) (any, error),
+) (data any, err error) {
if p == nil {
g.crl.Store(addr, true)
err = errors.ErrGRPCClientConnNotFound(addr)
@@ -837,7 +853,7 @@ func (g *gRPCClient) connectWithBackoff(ctx context.Context, p pool.Conn, addr s
if boName = FromGRPCMethod(sctx); boName != "" {
sctx = backoff.WithBackoffName(sctx, boName)
}
- do := func(ctx context.Context) (r interface{}, ret bool, err error) {
+ do := func(ctx context.Context) (r any, ret bool, err error) {
err = p.Do(ctx, func(conn *ClientConn) (err error) {
if conn == nil {
return errors.ErrGRPCClientConnNotFound(addr)
@@ -873,9 +889,9 @@ func (g *gRPCClient) connectWithBackoff(ctx context.Context, p pool.Conn, addr s
}
return r, false, nil
}
- data, err = g.bo.Do(sctx, func(ictx context.Context) (r interface{}, ret bool, err error) {
+ data, err = g.bo.Do(sctx, func(ictx context.Context) (r any, ret bool, err error) {
if g.cb != nil && len(boName) > 0 {
- r, err = g.cb.Do(ictx, boName, func(ictx context.Context) (interface{}, error) {
+ r, err = g.cb.Do(ictx, boName, func(ictx context.Context) (any, error) {
r, ret, err = do(ictx)
if err != nil && !ret {
return r, errors.NewErrCircuitBreakerIgnorable(err)
@@ -930,7 +946,9 @@ func (g *gRPCClient) GetBackoff() backoff.Backoff {
return g.bo
}
-func (g *gRPCClient) Connect(ctx context.Context, addr string, dopts ...DialOption) (conn pool.Conn, err error) {
+func (g *gRPCClient) Connect(
+ ctx context.Context, addr string, dopts ...DialOption,
+) (conn pool.Conn, err error) {
ctx, span := trace.StartSpan(ctx, apiName+"/Client.Connect/"+addr)
defer func() {
if span != nil {
diff --git a/internal/net/grpc/client_test.go b/internal/net/grpc/client_test.go
index da238411a4..facab61fbc 100644
--- a/internal/net/grpc/client_test.go
+++ b/internal/net/grpc/client_test.go
@@ -1051,7 +1051,7 @@ package grpc
// func Test_gRPCClient_RoundRobin(t *testing.T) {
// type args struct {
// ctx context.Context
-// f func(ctx context.Context, conn *ClientConn, copts ...CallOption) (interface{}, error)
+// f func(ctx context.Context, conn *ClientConn, copts ...CallOption) (any, error)
// }
// type fields struct {
// addrs map[string]struct{}
@@ -1078,7 +1078,7 @@ package grpc
// stopMonitor context.CancelFunc
// }
// type want struct {
-// wantData interface{}
+// wantData any
// err error
// }
// type test struct {
@@ -1086,11 +1086,11 @@ package grpc
// args args
// fields fields
// want want
-// checkFunc func(want, interface{}, error) error
+// checkFunc func(want, any, error) error
// beforeFunc func(*testing.T, args)
// afterFunc func(*testing.T, args)
// }
-// defaultCheckFunc := func(w want, gotData interface{}, err error) error {
+// defaultCheckFunc := func(w want, gotData any, err error) error {
// if !errors.Is(err, w.err) {
// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err)
// }
@@ -1242,7 +1242,7 @@ package grpc
// type args struct {
// ctx context.Context
// addr string
-// f func(ctx context.Context, conn *ClientConn, copts ...CallOption) (interface{}, error)
+// f func(ctx context.Context, conn *ClientConn, copts ...CallOption) (any, error)
// }
// type fields struct {
// addrs map[string]struct{}
@@ -1269,7 +1269,7 @@ package grpc
// stopMonitor context.CancelFunc
// }
// type want struct {
-// wantData interface{}
+// wantData any
// err error
// }
// type test struct {
@@ -1277,11 +1277,11 @@ package grpc
// args args
// fields fields
// want want
-// checkFunc func(want, interface{}, error) error
+// checkFunc func(want, any, error) error
// beforeFunc func(*testing.T, args)
// afterFunc func(*testing.T, args)
// }
-// defaultCheckFunc := func(w want, gotData interface{}, err error) error {
+// defaultCheckFunc := func(w want, gotData any, err error) error {
// if !errors.Is(err, w.err) {
// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err)
// }
@@ -1437,7 +1437,7 @@ package grpc
// p pool.Conn
// addr string
// enableBackoff bool
-// f func(ctx context.Context, conn *ClientConn, copts ...CallOption) (interface{}, error)
+// f func(ctx context.Context, conn *ClientConn, copts ...CallOption) (any, error)
// }
// type fields struct {
// addrs map[string]struct{}
@@ -1464,7 +1464,7 @@ package grpc
// stopMonitor context.CancelFunc
// }
// type want struct {
-// wantData interface{}
+// wantData any
// err error
// }
// type test struct {
@@ -1472,11 +1472,11 @@ package grpc
// args args
// fields fields
// want want
-// checkFunc func(want, interface{}, error) error
+// checkFunc func(want, any, error) error
// beforeFunc func(*testing.T, args)
// afterFunc func(*testing.T, args)
// }
-// defaultCheckFunc := func(w want, gotData interface{}, err error) error {
+// defaultCheckFunc := func(w want, gotData any, err error) error {
// if !errors.Is(err, w.err) {
// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err)
// }
diff --git a/internal/net/grpc/codec.go b/internal/net/grpc/codec.go
index f19824197b..588bbb70e1 100644
--- a/internal/net/grpc/codec.go
+++ b/internal/net/grpc/codec.go
@@ -34,7 +34,7 @@ type vtprotoMessage interface {
}
// Marshal returns byte slice representing the proto message marshalling result.
-func (Codec) Marshal(obj interface{}) (data []byte, err error) {
+func (Codec) Marshal(obj any) (data []byte, err error) {
switch v := obj.(type) {
case vtprotoMessage:
data, err = v.MarshalVT()
@@ -50,7 +50,7 @@ func (Codec) Marshal(obj interface{}) (data []byte, err error) {
}
// Unmarshal parses the byte stream data into v.
-func (Codec) Unmarshal(data []byte, obj interface{}) (err error) {
+func (Codec) Unmarshal(data []byte, obj any) (err error) {
switch v := obj.(type) {
case vtprotoMessage:
err = v.UnmarshalVT(data)
diff --git a/internal/net/grpc/codec_test.go b/internal/net/grpc/codec_test.go
index 6c9b941f70..4aa8c81c46 100644
--- a/internal/net/grpc/codec_test.go
+++ b/internal/net/grpc/codec_test.go
@@ -28,7 +28,7 @@ import (
func TestCodec_Marshal(t *testing.T) {
t.Parallel()
type args struct {
- v interface{}
+ v any
}
type want struct {
want []byte
@@ -121,7 +121,7 @@ func TestCodec_Unmarshal(t *testing.T) {
t.Parallel()
type args struct {
data []byte
- v interface{}
+ v any
}
type want struct {
err error
diff --git a/internal/net/grpc/errdetails/errdetails.go b/internal/net/grpc/errdetails/errdetails.go
index 1b24f34fc6..ad84b6c0b2 100644
--- a/internal/net/grpc/errdetails/errdetails.go
+++ b/internal/net/grpc/errdetails/errdetails.go
@@ -79,7 +79,7 @@ type Detail struct {
Message proto.Message `json:"message,omitempty" yaml:"message"`
}
-func decodeDetails(objs ...interface{}) (details []Detail) {
+func decodeDetails(objs ...any) (details []Detail) {
if objs == nil {
return nil
}
@@ -93,9 +93,9 @@ func decodeDetails(objs ...interface{}) (details []Detail) {
v = v.Elem()
}
if v.Kind() == reflect.Slice || v.Kind() == reflect.Array {
- iobjs := make([]interface{}, 0, v.Len())
+ iobjs := make([]any, 0, v.Len())
for i := 0; i < v.Len(); i++ {
- var val interface{}
+ var val any
if v.Index(i).Kind() == reflect.Ptr {
val = v.Index(i).Elem().Interface()
} else {
@@ -209,7 +209,7 @@ func decodeDetails(objs ...interface{}) (details []Detail) {
return details
}
-func Serialize(objs ...interface{}) string {
+func Serialize(objs ...any) string {
var (
b []byte
err error
@@ -326,9 +326,24 @@ func AnyToErrorDetail(a *types.Any) proto.Message {
return a.ProtoReflect().Interface()
}
-func DebugInfoFromInfoDetail(v *info.Detail) *DebugInfo {
- debug := &DebugInfo{
- Detail: strings.Join(append(append([]string{
+func DebugInfoFromInfoDetail(v *info.Detail) (debug *DebugInfo) {
+ debug = new(DebugInfo)
+ if v.StackTrace != nil {
+ debug.StackEntries = make([]string, 0, len(v.StackTrace))
+ for i, stack := range v.StackTrace {
+ debug.StackEntries = append(debug.GetStackEntries(), strings.Join([]string{
+ "id:",
+ strconv.Itoa(i),
+ "stack_trace:",
+ stack.String(),
+ }, " "))
+ }
+ v.StackTrace = nil
+ }
+ detail, err := json.Marshal(v)
+ if err != nil {
+ log.Warnf("failed to Marshal object %#v to JSON error: %v", v, err)
+ debug.Detail = strings.Join(append(append([]string{
"Version:", v.Version, ",",
"Name:", v.ServerName, ",",
"GitCommit:", v.GitCommit, ",",
@@ -339,18 +354,9 @@ func DebugInfoFromInfoDetail(v *info.Detail) *DebugInfo {
"GOOS:", v.GoOS, ",",
"CGO_Enabled:", v.CGOEnabled, ",",
"BuildCPUInfo: [",
- }, v.BuildCPUInfoFlags...), "]"), " "),
- }
- if debug.GetStackEntries() == nil {
- debug.StackEntries = make([]string, 0, len(v.StackTrace))
- }
- for i, stack := range v.StackTrace {
- debug.StackEntries = append(debug.GetStackEntries(), strings.Join([]string{
- "id:",
- strconv.Itoa(i),
- "stack_trace:",
- stack.String(),
- }, " "))
+ }, v.BuildCPUInfoFlags...), "]"), " ")
+ } else {
+ debug.Detail = string(detail)
}
return debug
}
diff --git a/internal/net/grpc/errdetails/errdetails_test.go b/internal/net/grpc/errdetails/errdetails_test.go
index 0dd719afce..0a80077106 100644
--- a/internal/net/grpc/errdetails/errdetails_test.go
+++ b/internal/net/grpc/errdetails/errdetails_test.go
@@ -29,7 +29,7 @@ import (
func Test_decodeDetails(t *testing.T) {
t.Parallel()
type args struct {
- objs []interface{}
+ objs []any
}
tests := []struct {
name string
@@ -50,7 +50,7 @@ func Test_decodeDetails(t *testing.T) {
func TestSerialize(t *testing.T) {
t.Parallel()
type args struct {
- objs []interface{}
+ objs []any
}
tests := []struct {
name string
diff --git a/internal/net/grpc/handler.go b/internal/net/grpc/handler.go
index 916a248aed..cb6cb0b936 100644
--- a/internal/net/grpc/handler.go
+++ b/internal/net/grpc/handler.go
@@ -17,9 +17,7 @@
// Package grpc provides generic functionality for grpc
package grpc
-import (
- "google.golang.org/grpc"
-)
+import "google.golang.org/grpc"
var (
StatsHandler = grpc.StatsHandler
diff --git a/internal/net/grpc/interceptor.go b/internal/net/grpc/interceptor.go
index ffe74f2c12..e6421b4268 100644
--- a/internal/net/grpc/interceptor.go
+++ b/internal/net/grpc/interceptor.go
@@ -17,9 +17,7 @@
// Package grpc provides generic functionality for grpc
package grpc
-import (
- "google.golang.org/grpc"
-)
+import "google.golang.org/grpc"
type (
UnaryServerInterceptor = grpc.UnaryServerInterceptor
diff --git a/internal/net/grpc/interceptor/client/trace/trace.go b/internal/net/grpc/interceptor/client/trace/trace.go
index aee5a63edc..baa4f81b31 100644
--- a/internal/net/grpc/interceptor/client/trace/trace.go
+++ b/internal/net/grpc/interceptor/client/trace/trace.go
@@ -13,9 +13,7 @@
// limitations under the License.
package trace
-import (
- "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
-)
+import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
var (
UnaryClientInterceptor = otelgrpc.UnaryClientInterceptor
diff --git a/internal/net/grpc/interceptor/server/logging/accesslog.go b/internal/net/grpc/interceptor/server/logging/accesslog.go
index 5da857a758..9de30d1aaa 100644
--- a/internal/net/grpc/interceptor/server/logging/accesslog.go
+++ b/internal/net/grpc/interceptor/server/logging/accesslog.go
@@ -52,10 +52,10 @@ type AccessLogGRPCEntity struct {
func AccessLogInterceptor() grpc.UnaryServerInterceptor {
return func(
ctx context.Context,
- req interface{},
+ req any,
info *grpc.UnaryServerInfo,
handler grpc.UnaryHandler,
- ) (resp interface{}, err error) {
+ ) (resp any, err error) {
var traceID string
span := trace.FromContext(ctx)
@@ -99,7 +99,7 @@ func AccessLogInterceptor() grpc.UnaryServerInterceptor {
func AccessLogStreamInterceptor() grpc.StreamServerInterceptor {
return func(
- srv interface{},
+ srv any,
ss grpc.ServerStream,
info *grpc.StreamServerInfo,
handler grpc.StreamHandler,
diff --git a/internal/net/grpc/interceptor/server/metric/metric.go b/internal/net/grpc/interceptor/server/metric/metric.go
index 15ced6c53e..574386d483 100644
--- a/internal/net/grpc/interceptor/server/metric/metric.go
+++ b/internal/net/grpc/interceptor/server/metric/metric.go
@@ -59,13 +59,13 @@ func MetricInterceptors() (grpc.UnaryServerInterceptor, grpc.StreamServerInterce
latencyHistgram.Record(ctx, latency, metrics.WithAttributes(attrs...))
completedRPCCnt.Add(ctx, 1, metrics.WithAttributes(attrs...))
}
- return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) {
+ return func(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp any, err error) {
now := time.Now()
resp, err = handler(ctx, req)
elapsedTime := time.Since(now)
record(ctx, info.FullMethod, err, float64(elapsedTime)/float64(time.Millisecond))
return resp, err
- }, func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) (err error) {
+ }, func(srv any, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) (err error) {
now := time.Now()
err = handler(srv, ss)
elapsedTime := time.Since(now)
diff --git a/internal/net/grpc/interceptor/server/recover/recover.go b/internal/net/grpc/interceptor/server/recover/recover.go
index 12a6a313d6..dfcfc0bd07 100644
--- a/internal/net/grpc/interceptor/server/recover/recover.go
+++ b/internal/net/grpc/interceptor/server/recover/recover.go
@@ -27,10 +27,10 @@ import (
func RecoverInterceptor() grpc.UnaryServerInterceptor {
return func(
ctx context.Context,
- req interface{},
+ req any,
info *grpc.UnaryServerInfo,
handler grpc.UnaryHandler,
- ) (resp interface{}, err error) {
+ ) (resp any, err error) {
err = safety.RecoverWithoutPanicFunc(func() (err error) {
resp, err = handler(ctx, req)
return err
@@ -41,7 +41,7 @@ func RecoverInterceptor() grpc.UnaryServerInterceptor {
func RecoverStreamInterceptor() grpc.StreamServerInterceptor {
return func(
- srv interface{},
+ srv any,
ss grpc.ServerStream,
info *grpc.StreamServerInfo,
handler grpc.StreamHandler,
diff --git a/internal/net/grpc/logger/logger.go b/internal/net/grpc/logger/logger.go
index 4c18a7d3ab..064b544a54 100644
--- a/internal/net/grpc/logger/logger.go
+++ b/internal/net/grpc/logger/logger.go
@@ -44,64 +44,64 @@ func Init() {
}
// Info prints the debug log to the logger.
-func (*logger) Info(args ...interface{}) {
+func (*logger) Info(args ...any) {
log.Debugd(tag, args...)
}
// Infoln prints the debug log to the logger.
-func (*logger) Infoln(args ...interface{}) {
+func (*logger) Infoln(args ...any) {
log.Debugd(tag, args...)
}
// Infof prints the debug log to the logger.
-func (*logger) Infof(format string, args ...interface{}) {
+func (*logger) Infof(format string, args ...any) {
log.Debugf(tag+"\t"+format, args...)
}
// Warning prints the warning log to the logger.
-func (*logger) Warning(args ...interface{}) {
+func (*logger) Warning(args ...any) {
log.Warnd(tag, args...)
}
// Warningln prints the warning log to the logger.
-func (*logger) Warningln(args ...interface{}) {
+func (*logger) Warningln(args ...any) {
log.Warnd(tag, args...)
}
// Warningf prints the warning log to the logger.
-func (*logger) Warningf(format string, args ...interface{}) {
+func (*logger) Warningf(format string, args ...any) {
log.Warnf(tag+"\t"+format, args...)
}
// Error prints the error log to the logger.
-func (*logger) Error(args ...interface{}) {
+func (*logger) Error(args ...any) {
log.Errord(tag, args...)
}
// Errorln prints the error log to the logger.
-func (*logger) Errorln(args ...interface{}) {
+func (*logger) Errorln(args ...any) {
log.Errord(tag, args...)
}
// Errorf prints the error log to the logger.
-func (*logger) Errorf(format string, args ...interface{}) {
+func (*logger) Errorf(format string, args ...any) {
log.Errorf(tag+"\t"+format, args...)
}
// Fatal prints the fatal log to the logger and exit the program.
-func (*logger) Fatal(args ...interface{}) {
+func (*logger) Fatal(args ...any) {
// skipcq: RVV-A0003
log.Fatald(tag, args...)
}
// Fatalln prints the fatal log to the logger and exit the program.
-func (*logger) Fatalln(args ...interface{}) {
+func (*logger) Fatalln(args ...any) {
// skipcq: RVV-A0003
log.Fatald(tag, args...)
}
// Fatalf prints the fatal log to the logger and exit the program.
-func (*logger) Fatalf(format string, args ...interface{}) {
+func (*logger) Fatalf(format string, args ...any) {
// skipcq: RVV-A0003
log.Fatalf(tag+"\t"+format, args...)
}
diff --git a/internal/net/grpc/logger/logger_test.go b/internal/net/grpc/logger/logger_test.go
index 7583e4c6d4..5d615d1e71 100644
--- a/internal/net/grpc/logger/logger_test.go
+++ b/internal/net/grpc/logger/logger_test.go
@@ -102,7 +102,7 @@ func TestInit(t *testing.T) {
func Test_logger_Info(t *testing.T) {
t.Parallel()
type args struct {
- args []interface{}
+ args []any
}
type fields struct {
v int
@@ -122,7 +122,7 @@ func Test_logger_Info(t *testing.T) {
{
name: "Info success to log the message",
args: args{
- args: []interface{}{"log message"},
+ args: []any{"log message"},
},
fields: fields{
v: 0,
@@ -158,7 +158,7 @@ func Test_logger_Info(t *testing.T) {
func Test_logger_Infoln(t *testing.T) {
t.Parallel()
type args struct {
- args []interface{}
+ args []any
}
type fields struct {
v int
@@ -178,7 +178,7 @@ func Test_logger_Infoln(t *testing.T) {
{
name: "Infoln success to log the message",
args: args{
- args: []interface{}{"log message"},
+ args: []any{"log message"},
},
fields: fields{
v: 0,
@@ -215,7 +215,7 @@ func Test_logger_Infof(t *testing.T) {
t.Parallel()
type args struct {
format string
- args []interface{}
+ args []any
}
type fields struct {
v int
@@ -235,7 +235,7 @@ func Test_logger_Infof(t *testing.T) {
{
name: "Infof success to log the message",
args: args{
- args: []interface{}{"log message"},
+ args: []any{"log message"},
},
fields: fields{
v: 0,
@@ -271,7 +271,7 @@ func Test_logger_Infof(t *testing.T) {
func Test_logger_Warning(t *testing.T) {
t.Parallel()
type args struct {
- args []interface{}
+ args []any
}
type fields struct {
v int
@@ -291,7 +291,7 @@ func Test_logger_Warning(t *testing.T) {
{
name: "Warning success to log the message",
args: args{
- args: []interface{}{"log message"},
+ args: []any{"log message"},
},
fields: fields{
v: 0,
@@ -327,7 +327,7 @@ func Test_logger_Warning(t *testing.T) {
func Test_logger_Warningln(t *testing.T) {
t.Parallel()
type args struct {
- args []interface{}
+ args []any
}
type fields struct {
v int
@@ -347,7 +347,7 @@ func Test_logger_Warningln(t *testing.T) {
{
name: "Warningln success to log the message",
args: args{
- args: []interface{}{"log message"},
+ args: []any{"log message"},
},
fields: fields{
v: 0,
@@ -384,7 +384,7 @@ func Test_logger_Warningf(t *testing.T) {
t.Parallel()
type args struct {
format string
- args []interface{}
+ args []any
}
type fields struct {
v int
@@ -404,7 +404,7 @@ func Test_logger_Warningf(t *testing.T) {
{
name: "Warningf success to log the message",
args: args{
- args: []interface{}{"log message"},
+ args: []any{"log message"},
},
fields: fields{
v: 0,
@@ -440,7 +440,7 @@ func Test_logger_Warningf(t *testing.T) {
func Test_logger_Error(t *testing.T) {
t.Parallel()
type args struct {
- args []interface{}
+ args []any
}
type fields struct {
v int
@@ -460,7 +460,7 @@ func Test_logger_Error(t *testing.T) {
{
name: "Error success to log the message",
args: args{
- args: []interface{}{"log message"},
+ args: []any{"log message"},
},
fields: fields{
v: 0,
@@ -496,7 +496,7 @@ func Test_logger_Error(t *testing.T) {
func Test_logger_Errorln(t *testing.T) {
t.Parallel()
type args struct {
- args []interface{}
+ args []any
}
type fields struct {
v int
@@ -516,7 +516,7 @@ func Test_logger_Errorln(t *testing.T) {
{
name: "Errorln success to log the message",
args: args{
- args: []interface{}{"log message"},
+ args: []any{"log message"},
},
fields: fields{
v: 0,
@@ -553,7 +553,7 @@ func Test_logger_Errorf(t *testing.T) {
t.Parallel()
type args struct {
format string
- args []interface{}
+ args []any
}
type fields struct {
v int
@@ -573,7 +573,7 @@ func Test_logger_Errorf(t *testing.T) {
{
name: "Errorf success to log the message",
args: args{
- args: []interface{}{"log message"},
+ args: []any{"log message"},
},
fields: fields{
v: 0,
@@ -618,7 +618,7 @@ func Test_logger_Fatal(t *testing.T) {
}
type args struct {
- args []interface{}
+ args []any
}
type fields struct {
v int
@@ -638,7 +638,7 @@ func Test_logger_Fatal(t *testing.T) {
{
name: "Fatal log the message",
args: args{
- args: []interface{}{"log message"},
+ args: []any{"log message"},
},
fields: fields{
v: 0,
@@ -687,7 +687,7 @@ func Test_logger_Fatalln(t *testing.T) {
}
type args struct {
- args []interface{}
+ args []any
}
type fields struct {
v int
@@ -707,7 +707,7 @@ func Test_logger_Fatalln(t *testing.T) {
{
name: "Fatalln log the message",
args: args{
- args: []interface{}{"log message"},
+ args: []any{"log message"},
},
fields: fields{
v: 0,
@@ -753,7 +753,7 @@ func Test_logger_Fatalf(t *testing.T) {
type args struct {
format string
- args []interface{}
+ args []any
}
type fields struct {
v int
@@ -773,7 +773,7 @@ func Test_logger_Fatalf(t *testing.T) {
{
name: "Fatalf log the message",
args: args{
- args: []interface{}{"log message"},
+ args: []any{"log message"},
},
fields: fields{
v: 0,
diff --git a/internal/net/grpc/pool/pool.go b/internal/net/grpc/pool/pool.go
index 9bb199ac2a..e0c3d34776 100644
--- a/internal/net/grpc/pool/pool.go
+++ b/internal/net/grpc/pool/pool.go
@@ -229,7 +229,9 @@ func (p *pool) store(idx int, pc *poolConn) {
p.pmu.RUnlock()
}
-func (p *pool) loop(ctx context.Context, fn func(ctx context.Context, idx int, pc *poolConn) bool) (err error) {
+func (p *pool) loop(
+ ctx context.Context, fn func(ctx context.Context, idx int, pc *poolConn) bool,
+) (err error) {
if p == nil || fn == nil {
return nil
}
@@ -494,7 +496,7 @@ func (p *pool) dial(ctx context.Context, addr string) (conn *ClientConn, err err
}
if p.bo != nil {
retry := 0
- _, err = p.bo.Do(ctx, func(ctx context.Context) (r interface{}, ret bool, err error) {
+ _, err = p.bo.Do(ctx, func(ctx context.Context) (r any, ret bool, err error) {
log.Debugf("dialing to %s with backoff, retry: %d", addr, retry)
conn, err = do()
retry++
diff --git a/internal/net/grpc/status/status.go b/internal/net/grpc/status/status.go
index bea96c2921..cfd0ff085f 100644
--- a/internal/net/grpc/status/status.go
+++ b/internal/net/grpc/status/status.go
@@ -41,76 +41,76 @@ func New(c codes.Code, msg string) *Status {
return status.New(c, msg)
}
-func newStatus(code codes.Code, msg string, err error, details ...interface{}) (st *Status) {
+func newStatus(code codes.Code, msg string, err error, details ...any) (st *Status) {
st = New(code, msg)
return withDetails(st, err, details...)
}
-func WrapWithCanceled(msg string, err error, details ...interface{}) error {
+func WrapWithCanceled(msg string, err error, details ...any) error {
return newStatus(codes.Canceled, msg, err, details...).Err()
}
-func WrapWithUnknown(msg string, err error, details ...interface{}) error {
+func WrapWithUnknown(msg string, err error, details ...any) error {
return newStatus(codes.Unknown, msg, err, details...).Err()
}
-func WrapWithInvalidArgument(msg string, err error, details ...interface{}) error {
+func WrapWithInvalidArgument(msg string, err error, details ...any) error {
return newStatus(codes.InvalidArgument, msg, err, details...).Err()
}
-func WrapWithDeadlineExceeded(msg string, err error, details ...interface{}) error {
+func WrapWithDeadlineExceeded(msg string, err error, details ...any) error {
return newStatus(codes.DeadlineExceeded, msg, err, details...).Err()
}
-func WrapWithNotFound(msg string, err error, details ...interface{}) error {
+func WrapWithNotFound(msg string, err error, details ...any) error {
return newStatus(codes.NotFound, msg, err, details...).Err()
}
-func WrapWithAlreadyExists(msg string, err error, details ...interface{}) error {
+func WrapWithAlreadyExists(msg string, err error, details ...any) error {
return newStatus(codes.AlreadyExists, msg, err, details...).Err()
}
-func WrapWithPermissionDenied(msg string, err error, details ...interface{}) error {
+func WrapWithPermissionDenied(msg string, err error, details ...any) error {
return newStatus(codes.PermissionDenied, msg, err, details...).Err()
}
-func WrapWithResourceExhausted(msg string, err error, details ...interface{}) error {
+func WrapWithResourceExhausted(msg string, err error, details ...any) error {
return newStatus(codes.ResourceExhausted, msg, err, details...).Err()
}
-func WrapWithFailedPrecondition(msg string, err error, details ...interface{}) error {
+func WrapWithFailedPrecondition(msg string, err error, details ...any) error {
return newStatus(codes.FailedPrecondition, msg, err, details...).Err()
}
-func WrapWithAborted(msg string, err error, details ...interface{}) error {
+func WrapWithAborted(msg string, err error, details ...any) error {
return newStatus(codes.Aborted, msg, err, details...).Err()
}
-func WrapWithOutOfRange(msg string, err error, details ...interface{}) error {
+func WrapWithOutOfRange(msg string, err error, details ...any) error {
return newStatus(codes.OutOfRange, msg, err, details...).Err()
}
-func WrapWithUnimplemented(msg string, err error, details ...interface{}) error {
+func WrapWithUnimplemented(msg string, err error, details ...any) error {
return newStatus(codes.Unimplemented, msg, err, details...).Err()
}
-func WrapWithInternal(msg string, err error, details ...interface{}) error {
+func WrapWithInternal(msg string, err error, details ...any) error {
return newStatus(codes.Internal, msg, err, details...).Err()
}
-func WrapWithUnavailable(msg string, err error, details ...interface{}) error {
+func WrapWithUnavailable(msg string, err error, details ...any) error {
return newStatus(codes.Unavailable, msg, err, details...).Err()
}
-func WrapWithDataLoss(msg string, err error, details ...interface{}) error {
+func WrapWithDataLoss(msg string, err error, details ...any) error {
return newStatus(codes.DataLoss, msg, err, details...).Err()
}
-func WrapWithUnauthenticated(msg string, err error, details ...interface{}) error {
+func WrapWithUnauthenticated(msg string, err error, details ...any) error {
return newStatus(codes.Unauthenticated, msg, err, details...).Err()
}
-func CreateWithNotFound(msg string, err error, details ...interface{}) *Status {
+func CreateWithNotFound(msg string, err error, details ...any) *Status {
return newStatus(codes.NotFound, msg, err, details...)
}
@@ -118,11 +118,13 @@ func Error(code codes.Code, msg string) error {
return status.Error(code, msg)
}
-func Errorf(code codes.Code, format string, args ...interface{}) error {
+func Errorf(code codes.Code, format string, args ...any) error {
return status.Errorf(code, format, args...)
}
-func ParseError(err error, defaultCode codes.Code, defaultMsg string, details ...interface{}) (st *Status, msg string, rerr error) {
+func ParseError(
+ err error, defaultCode codes.Code, defaultMsg string, details ...any,
+) (st *Status, msg string, rerr error) {
if err == nil {
st = newStatus(codes.OK, "", nil, details...)
msg = st.Message()
@@ -234,7 +236,7 @@ func FromError(err error) (st *Status, ok bool) {
}
}
-func withDetails(st *Status, err error, details ...interface{}) *Status {
+func withDetails(st *Status, err error, details ...any) *Status {
msgs := make([]proto.MessageV1, 0, 1+len(details)*2)
if err != nil {
msgs = append(msgs, &errdetails.ErrorInfo{
diff --git a/internal/net/grpc/status/status_test.go b/internal/net/grpc/status/status_test.go
index 04d386bc64..31c18c01d7 100644
--- a/internal/net/grpc/status/status_test.go
+++ b/internal/net/grpc/status/status_test.go
@@ -40,7 +40,7 @@ func TestParseError(t *testing.T) {
err error
defaultCode codes.Code
defaultMsg string
- details []interface{}
+ details []any
}
type want struct {
wantSt codes.Code
@@ -248,7 +248,7 @@ func TestParseError(t *testing.T) {
// code codes.Code
// msg string
// err error
-// details []interface{}
+// details []any
// }
// type want struct {
// wantSt *Status
@@ -342,7 +342,7 @@ func TestParseError(t *testing.T) {
// type args struct {
// msg string
// err error
-// details []interface{}
+// details []any
// }
// type want struct {
// err error
@@ -434,7 +434,7 @@ func TestParseError(t *testing.T) {
// type args struct {
// msg string
// err error
-// details []interface{}
+// details []any
// }
// type want struct {
// err error
@@ -526,7 +526,7 @@ func TestParseError(t *testing.T) {
// type args struct {
// msg string
// err error
-// details []interface{}
+// details []any
// }
// type want struct {
// err error
@@ -618,7 +618,7 @@ func TestParseError(t *testing.T) {
// type args struct {
// msg string
// err error
-// details []interface{}
+// details []any
// }
// type want struct {
// err error
@@ -710,7 +710,7 @@ func TestParseError(t *testing.T) {
// type args struct {
// msg string
// err error
-// details []interface{}
+// details []any
// }
// type want struct {
// err error
@@ -802,7 +802,7 @@ func TestParseError(t *testing.T) {
// type args struct {
// msg string
// err error
-// details []interface{}
+// details []any
// }
// type want struct {
// err error
@@ -894,7 +894,7 @@ func TestParseError(t *testing.T) {
// type args struct {
// msg string
// err error
-// details []interface{}
+// details []any
// }
// type want struct {
// err error
@@ -986,7 +986,7 @@ func TestParseError(t *testing.T) {
// type args struct {
// msg string
// err error
-// details []interface{}
+// details []any
// }
// type want struct {
// err error
@@ -1078,7 +1078,7 @@ func TestParseError(t *testing.T) {
// type args struct {
// msg string
// err error
-// details []interface{}
+// details []any
// }
// type want struct {
// err error
@@ -1170,7 +1170,7 @@ func TestParseError(t *testing.T) {
// type args struct {
// msg string
// err error
-// details []interface{}
+// details []any
// }
// type want struct {
// err error
@@ -1262,7 +1262,7 @@ func TestParseError(t *testing.T) {
// type args struct {
// msg string
// err error
-// details []interface{}
+// details []any
// }
// type want struct {
// err error
@@ -1354,7 +1354,7 @@ func TestParseError(t *testing.T) {
// type args struct {
// msg string
// err error
-// details []interface{}
+// details []any
// }
// type want struct {
// err error
@@ -1446,7 +1446,7 @@ func TestParseError(t *testing.T) {
// type args struct {
// msg string
// err error
-// details []interface{}
+// details []any
// }
// type want struct {
// err error
@@ -1538,7 +1538,7 @@ func TestParseError(t *testing.T) {
// type args struct {
// msg string
// err error
-// details []interface{}
+// details []any
// }
// type want struct {
// err error
@@ -1630,7 +1630,7 @@ func TestParseError(t *testing.T) {
// type args struct {
// msg string
// err error
-// details []interface{}
+// details []any
// }
// type want struct {
// err error
@@ -1722,7 +1722,7 @@ func TestParseError(t *testing.T) {
// type args struct {
// msg string
// err error
-// details []interface{}
+// details []any
// }
// type want struct {
// err error
@@ -1814,7 +1814,7 @@ func TestParseError(t *testing.T) {
// type args struct {
// msg string
// err error
-// details []interface{}
+// details []any
// }
// type want struct {
// want *Status
@@ -1995,7 +1995,7 @@ func TestParseError(t *testing.T) {
// type args struct {
// code codes.Code
// format string
-// args []interface{}
+// args []any
// }
// type want struct {
// err error
@@ -2177,7 +2177,7 @@ func TestParseError(t *testing.T) {
// type args struct {
// st *Status
// err error
-// details []interface{}
+// details []any
// }
// type want struct {
// want *Status
diff --git a/internal/net/grpc/stream.go b/internal/net/grpc/stream.go
index 492280a804..73927fcf9a 100644
--- a/internal/net/grpc/stream.go
+++ b/internal/net/grpc/stream.go
@@ -45,7 +45,9 @@ type (
// It receives messages from the stream, calls the function with the received message, and sends the returned message to the stream.
// It limits the number of concurrent calls to the function with the concurrency integer.
// It records errors and returns them as a single error.
-func BidirectionalStream[Q any, R any](ctx context.Context, stream ServerStream,
+func BidirectionalStream[Q any, R any](
+ ctx context.Context,
+ stream ServerStream,
concurrency int,
f func(context.Context, *Q) (*R, error),
) (err error) {
@@ -165,9 +167,8 @@ func BidirectionalStream[Q any, R any](ctx context.Context, stream ServerStream,
}
// BidirectionalStreamClient is gRPC client stream.
-func BidirectionalStreamClient(stream ClientStream,
- dataProvider, newData func() interface{},
- f func(interface{}, error),
+func BidirectionalStreamClient(
+ stream ClientStream, dataProvider, newData func() any, f func(any, error),
) (err error) {
if stream == nil {
return errors.ErrGRPCClientStreamNotFound
diff --git a/internal/net/grpc/stream_test.go b/internal/net/grpc/stream_test.go
index dbe00b6130..d8b715dca7 100644
--- a/internal/net/grpc/stream_test.go
+++ b/internal/net/grpc/stream_test.go
@@ -170,7 +170,7 @@ func TestBidirectionalStream(t *testing.T) {
ContextFunc: func() context.Context {
return ctx
},
- RecvMsgFunc: func(i interface{}) error {
+ RecvMsgFunc: func(i any) error {
if recvIdx >= len(insertReqs) {
return io.EOF
}
@@ -184,7 +184,7 @@ func TestBidirectionalStream(t *testing.T) {
return nil
},
- SendMsgFunc: func(i interface{}) error {
+ SendMsgFunc: func(i any) error {
rpcResp = append(rpcResp, i.(*payload.Object_StreamLocation))
return nil
},
@@ -204,9 +204,9 @@ func TestBidirectionalStream(t *testing.T) {
// func TestBidirectionalStreamClient(t *testing.T) {
// type args struct {
// stream ClientStream
-// dataProvider func() interface{}
-// newData func() interface{}
-// f func(interface{}, error)
+// dataProvider func() any
+// newData func() any
+// f func(any, error)
// }
// type want struct {
// err error
diff --git a/internal/net/grpc/types/types.go b/internal/net/grpc/types/types.go
index ad4332554b..9a523fa2f7 100644
--- a/internal/net/grpc/types/types.go
+++ b/internal/net/grpc/types/types.go
@@ -26,6 +26,6 @@ import (
type Any = anypb.Any
// UnmarshalAny unmarshal protocol buffer message to any.
-func UnmarshalAny(any *Any, m proto.Message) error {
- return any.UnmarshalTo(m)
+func UnmarshalAny(a *Any, m proto.Message) error {
+ return a.UnmarshalTo(m)
}
diff --git a/internal/net/http/dump/dump.go b/internal/net/http/dump/dump.go
index 89d806e281..4e9734baad 100644
--- a/internal/net/http/dump/dump.go
+++ b/internal/net/http/dump/dump.go
@@ -23,22 +23,22 @@ import (
"github.com/vdaas/vald/internal/errors"
)
-func Request(values, body map[string]interface{}, r *http.Request) (res interface{}, err error) {
+func Request(values, body map[string]any, r *http.Request) (res any, err error) {
if r == nil {
return nil, errors.ErrInvalidRequest
}
return struct {
- Host string `json:"host"`
- URI string `json:"uri"`
- URL string `json:"url"`
- Method string `json:"method"`
- Proto string `json:"proto"`
- Header http.Header `json:"header"`
- TransferEncoding []string `json:"transfer_encoding"`
- RemoteAddr string `json:"remote_addr"`
- ContentLength int64 `json:"content_length"`
- Body map[string]interface{} `json:"body"`
- Values map[string]interface{} `json:"values"`
+ Host string `json:"host"`
+ URI string `json:"uri"`
+ URL string `json:"url"`
+ Method string `json:"method"`
+ Proto string `json:"proto"`
+ Header http.Header `json:"header"`
+ TransferEncoding []string `json:"transfer_encoding"`
+ RemoteAddr string `json:"remote_addr"`
+ ContentLength int64 `json:"content_length"`
+ Body map[string]any `json:"body"`
+ Values map[string]any `json:"values"`
}{
Host: r.Host,
URI: r.RequestURI,
diff --git a/internal/net/http/dump/dump_test.go b/internal/net/http/dump/dump_test.go
index 40dd5539c2..4e535713e0 100644
--- a/internal/net/http/dump/dump_test.go
+++ b/internal/net/http/dump/dump_test.go
@@ -31,15 +31,15 @@ func TestMain(m *testing.M) {
func TestRequest(t *testing.T) {
t.Parallel()
type args struct {
- values map[string]interface{}
- body map[string]interface{}
+ values map[string]any
+ body map[string]any
r *http.Request
}
type test struct {
name string
args args
- checkFunc func(res interface{}, err error) error
+ checkFunc func(res any, err error) error
}
tests := []test{
@@ -61,14 +61,14 @@ func TestRequest(t *testing.T) {
RemoteAddr: "0.0.0.0",
ContentLength: 1234,
},
- body: map[string]interface{}{
+ body: map[string]any{
"name": "vald",
},
- values: map[string]interface{}{
+ values: map[string]any{
"version": "1.0.0",
},
},
- checkFunc: func(res interface{}, err error) error {
+ checkFunc: func(res any, err error) error {
if err != nil {
return errors.Errorf("err is not nil. err: %v", err)
}
@@ -88,7 +88,7 @@ func TestRequest(t *testing.T) {
},
{
name: "returns nil and error",
- checkFunc: func(res interface{}, err error) error {
+ checkFunc: func(res any, err error) error {
if got, want := err, errors.ErrInvalidRequest; !errors.Is(got, want) {
return errors.Errorf("err not equals. want: %v, got: %v", want, got)
}
diff --git a/internal/net/http/json/json.go b/internal/net/http/json/json.go
index aed11fa6cb..f93608be5e 100644
--- a/internal/net/http/json/json.go
+++ b/internal/net/http/json/json.go
@@ -32,18 +32,16 @@ import (
// RFC7807Error represents RFC 7807 error.
type RFC7807Error struct {
- Type string `json:"type"`
- Title string `json:"title"`
- Detail interface{} `json:"detail"`
- Instance string `json:"instance"`
- Status int `json:"status"`
- Error string `json:"error"`
+ Type string `json:"type"`
+ Title string `json:"title"`
+ Detail any `json:"detail"`
+ Instance string `json:"instance"`
+ Status int `json:"status"`
+ Error string `json:"error"`
}
// EncodeResponse encodes http response body.
-func EncodeResponse(w http.ResponseWriter,
- data interface{}, status int, contentTypes ...string,
-) error {
+func EncodeResponse(w http.ResponseWriter, data any, status int, contentTypes ...string) error {
for _, ct := range contentTypes {
w.Header().Add(rest.ContentType, ct)
}
@@ -52,7 +50,7 @@ func EncodeResponse(w http.ResponseWriter,
}
// DecodeResponse decodes http response body.
-func DecodeResponse(res *http.Response, data interface{}) (err error) {
+func DecodeResponse(res *http.Response, data any) (err error) {
if res != nil && res.Body != nil && data != nil && res.ContentLength != 0 {
err = json.Decode(res.Body, data)
if err != nil {
@@ -73,9 +71,7 @@ func DecodeResponse(res *http.Response, data interface{}) (err error) {
}
// EncodeRequest encodes http request.
-func EncodeRequest(req *http.Request,
- data interface{}, contentTypes ...string,
-) error {
+func EncodeRequest(req *http.Request, data any, contentTypes ...string) error {
for _, ct := range contentTypes {
req.Header.Add(rest.ContentType, ct)
}
@@ -92,7 +88,7 @@ func EncodeRequest(req *http.Request,
}
// DecodeRequest decodes http request body.
-func DecodeRequest(r *http.Request, data interface{}) (err error) {
+func DecodeRequest(r *http.Request, data any) (err error) {
if r != nil && r.Body != nil && r.ContentLength != 0 {
err = json.Decode(r.Body, data)
if err != nil {
@@ -112,8 +108,8 @@ func DecodeRequest(r *http.Request, data interface{}) (err error) {
}
// Handler responds to an HTTP request to perform a logic function.
-func Handler(w http.ResponseWriter, r *http.Request,
- data interface{}, logic func() (interface{},
+func Handler(
+ w http.ResponseWriter, r *http.Request, data any, logic func() (any,
error),
) (code int, err error) {
err = DecodeRequest(r, &data)
@@ -133,9 +129,7 @@ func Handler(w http.ResponseWriter, r *http.Request,
}
// ErrorHandler responds to an HTTP request to send RFC 7807 error.
-func ErrorHandler(w http.ResponseWriter, r *http.Request,
- msg string, code int, err error,
-) error {
+func ErrorHandler(w http.ResponseWriter, r *http.Request, msg string, code int, err error) error {
data := RFC7807Error{
Type: r.RequestURI,
Title: msg,
@@ -146,7 +140,7 @@ func ErrorHandler(w http.ResponseWriter, r *http.Request,
if err != nil {
log.Error(err)
}
- body := make(map[string]interface{})
+ body := make(map[string]any)
err = json.Decode(r.Body, &body)
if err != nil {
log.Error(err)
@@ -168,7 +162,7 @@ func ErrorHandler(w http.ResponseWriter, r *http.Request,
}
// Request sends http json request.
-func Request(ctx context.Context, method, url string, payload, data interface{}) error {
+func Request(ctx context.Context, method, url string, payload, data any) error {
req, err := http.NewRequestWithContext(ctx, method, url, nil)
if err != nil {
return err
diff --git a/internal/net/http/json/json_test.go b/internal/net/http/json/json_test.go
index 221a7f64a6..a0f3dbef24 100644
--- a/internal/net/http/json/json_test.go
+++ b/internal/net/http/json/json_test.go
@@ -41,7 +41,7 @@ func TestEncodeResponse(t *testing.T) {
t.Parallel()
type args struct {
w http.ResponseWriter
- data interface{}
+ data any
status int
contentTypes []string
}
@@ -184,7 +184,7 @@ func TestHandler(t *testing.T) {
w http.ResponseWriter
r *http.Request
data map[string]string
- logic func() (interface{}, error)
+ logic func() (any, error)
}
type test struct {
name string
@@ -209,7 +209,7 @@ func TestHandler(t *testing.T) {
r: r,
w: w,
data: data,
- logic: func() (interface{}, error) {
+ logic: func() (any, error) {
return "hello", nil
},
},
@@ -267,7 +267,7 @@ func TestHandler(t *testing.T) {
args: args{
r: r,
data: make(map[string]string),
- logic: func() (interface{}, error) {
+ logic: func() (any, error) {
return nil, wantErr
},
},
@@ -300,7 +300,7 @@ func TestHandler(t *testing.T) {
}(),
w: new(httptest.ResponseRecorder),
data: make(map[string]string),
- logic: func() (interface{}, error) {
+ logic: func() (any, error) {
return func() {}, nil
},
},
@@ -401,7 +401,7 @@ func TestDecodeResponse(t *testing.T) {
t.Parallel()
type args struct {
res *http.Response
- data interface{}
+ data any
}
type want struct {
err error
@@ -426,7 +426,7 @@ func TestDecodeResponse(t *testing.T) {
name: "returns nil when response is nil",
args: args{
res: nil,
- data: new(interface{}),
+ data: new(any),
},
want: want{
err: nil,
@@ -440,7 +440,7 @@ func TestDecodeResponse(t *testing.T) {
res: &http.Response{
Body: nil,
},
- data: new(interface{}),
+ data: new(any),
},
want: want{
err: nil,
@@ -469,7 +469,7 @@ func TestDecodeResponse(t *testing.T) {
Body: io.NopCloser(new(bytes.Buffer)),
ContentLength: 0,
},
- data: new(interface{}),
+ data: new(any),
},
want: want{
err: nil,
@@ -484,7 +484,7 @@ func TestDecodeResponse(t *testing.T) {
Body: io.NopCloser(strings.NewReader("1+3i")),
ContentLength: 2,
},
- data: new(interface{}),
+ data: new(any),
},
want: want{
err: &strconv.NumError{
@@ -551,7 +551,7 @@ func TestEncodeRequest(t *testing.T) {
t.Parallel()
type args struct {
req *http.Request
- data interface{}
+ data any
contentTypes []string
}
type want struct {
@@ -666,8 +666,8 @@ func TestRequest(t *testing.T) {
ctx context.Context
method string
url string
- payloyd interface{}
- data interface{}
+ payloyd any
+ data any
}
type want struct {
err error
@@ -710,7 +710,7 @@ func TestRequest(t *testing.T) {
method: "POST",
url: "/",
payloyd: 1 + 3i,
- data: new(interface{}),
+ data: new(any),
},
checkFunc: func(w want, err error) error {
if w.err != nil && err != nil && !strings.HasPrefix(err.Error(), w.err.Error()) {
@@ -731,7 +731,7 @@ func TestRequest(t *testing.T) {
method: "POST",
url: "/",
payloyd: "1",
- data: new(interface{}),
+ data: new(any),
},
want: want{
err: &url.Error{
diff --git a/internal/net/http/metrics/pprof.go b/internal/net/http/metrics/pprof.go
index d7d5c258ce..30a5dbe3d9 100644
--- a/internal/net/http/metrics/pprof.go
+++ b/internal/net/http/metrics/pprof.go
@@ -22,6 +22,7 @@ import (
"net/http/pprof"
"github.com/felixge/fgprof"
+ pyprof "github.com/grafana/pyroscope-go/godeltaprof/http/pprof"
"github.com/vdaas/vald/internal/net/http/rest"
"github.com/vdaas/vald/internal/net/http/routing"
)
@@ -116,6 +117,30 @@ func GetProfileRoutes() (r []routing.Route) {
Pattern: "/debug/pprof/mutex",
HandlerFunc: rest.HandlerToRestFunc(pprof.Handler("mutex").ServeHTTP),
},
+ {
+ Name: "Debug Heap delta profile",
+ Methods: []string{
+ http.MethodGet,
+ },
+ Pattern: "/debug/pprof/delta_heap",
+ HandlerFunc: rest.HandlerToRestFunc(pyprof.Heap),
+ },
+ {
+ Name: "Debug mutex delta profile",
+ Methods: []string{
+ http.MethodGet,
+ },
+ Pattern: "/debug/pprof/delta_mutex",
+ HandlerFunc: rest.HandlerToRestFunc(pyprof.Mutex),
+ },
+ {
+ Name: "Debug mutex profile",
+ Methods: []string{
+ http.MethodGet,
+ },
+ Pattern: "/debug/pprof/delta_block",
+ HandlerFunc: rest.HandlerToRestFunc(pyprof.Block),
+ },
{
Name: "Debug fgprof profile",
Methods: []string{
diff --git a/internal/net/http/rest/rest.go b/internal/net/http/rest/rest.go
index 3508be7d0c..3ea905a2f4 100644
--- a/internal/net/http/rest/rest.go
+++ b/internal/net/http/rest/rest.go
@@ -17,9 +17,7 @@
// Package rest provides REST API common logic & variable
package rest
-import (
- "net/http"
-)
+import "net/http"
type Func func(http.ResponseWriter, *http.Request) (code int, err error)
diff --git a/internal/net/http/routing/router.go b/internal/net/http/routing/router.go
index 4400571c76..b78109d901 100644
--- a/internal/net/http/routing/router.go
+++ b/internal/net/http/routing/router.go
@@ -60,9 +60,7 @@ func New(opts ...Option) http.Handler {
// routing wraps the handler.Func and returns a new http.Handler.
// routing helps to handle unsupported HTTP method, timeout,
// and the error returned from the handler.Func.
-func (*router) routing(
- name, _ string, m []string, h rest.Func,
-) http.Handler {
+func (*router) routing(name, _ string, m []string, h rest.Func) http.Handler {
return http.HandlerFunc(
func(w http.ResponseWriter, r *http.Request) {
var (
diff --git a/internal/net/http/transport/roundtrip.go b/internal/net/http/transport/roundtrip.go
index 128c6231e6..9048bf9f76 100644
--- a/internal/net/http/transport/roundtrip.go
+++ b/internal/net/http/transport/roundtrip.go
@@ -54,7 +54,7 @@ func (e *ert) RoundTrip(req *http.Request) (res *http.Response, err error) {
if e.bo == nil {
return e.doRoundTrip(req)
}
- _, err = e.bo.Do(req.Context(), func(ctx context.Context) (interface{}, bool, error) {
+ _, err = e.bo.Do(req.Context(), func(ctx context.Context) (any, bool, error) {
r, err := e.doRoundTrip(req)
if err != nil {
return nil, errors.Is(err, errors.ErrTransportRetryable), err
diff --git a/internal/net/http/transport/roundtrip_mock.go b/internal/net/http/transport/roundtrip_mock.go
index f3a0549efb..82b49bfe2b 100644
--- a/internal/net/http/transport/roundtrip_mock.go
+++ b/internal/net/http/transport/roundtrip_mock.go
@@ -27,11 +27,13 @@ func (rm *roundTripMock) RoundTrip(req *http.Request) (*http.Response, error) {
}
type backoffMock struct {
- DoFunc func(context.Context, func(context.Context) (interface{}, bool, error)) (interface{}, error)
+ DoFunc func(context.Context, func(context.Context) (any, bool, error)) (any, error)
CloseFunc func()
}
-func (bm *backoffMock) Do(ctx context.Context, fn func(context.Context) (interface{}, bool, error)) (interface{}, error) {
+func (bm *backoffMock) Do(
+ ctx context.Context, fn func(context.Context) (any, bool, error),
+) (any, error) {
return bm.DoFunc(ctx, fn)
}
diff --git a/internal/net/http/transport/roundtrip_test.go b/internal/net/http/transport/roundtrip_test.go
index f295d50f64..0af9f6a5f3 100644
--- a/internal/net/http/transport/roundtrip_test.go
+++ b/internal/net/http/transport/roundtrip_test.go
@@ -178,7 +178,7 @@ func Test_ert_RoundTrip(t *testing.T) {
},
},
bo: &backoffMock{
- DoFunc: func(ctx context.Context, fn func(context.Context) (interface{}, bool, error)) (interface{}, error) {
+ DoFunc: func(ctx context.Context, fn func(context.Context) (any, bool, error)) (any, error) {
val, _, err := fn(ctx)
return val, err
},
@@ -204,7 +204,7 @@ func Test_ert_RoundTrip(t *testing.T) {
},
},
bo: &backoffMock{
- DoFunc: func(ctx context.Context, fn func(context.Context) (interface{}, bool, error)) (interface{}, error) {
+ DoFunc: func(ctx context.Context, fn func(context.Context) (any, bool, error)) (any, error) {
val, _, err := fn(ctx)
return val, err
},
@@ -230,7 +230,7 @@ func Test_ert_RoundTrip(t *testing.T) {
},
},
bo: &backoffMock{
- DoFunc: func(ctx context.Context, fn func(context.Context) (interface{}, bool, error)) (interface{}, error) {
+ DoFunc: func(ctx context.Context, fn func(context.Context) (any, bool, error)) (any, error) {
val, _, err := fn(ctx)
return val, err
},
@@ -249,7 +249,7 @@ func Test_ert_RoundTrip(t *testing.T) {
},
fields: fields{
bo: &backoffMock{
- DoFunc: func(ctx context.Context, fn func(context.Context) (interface{}, bool, error)) (interface{}, error) {
+ DoFunc: func(ctx context.Context, fn func(context.Context) (any, bool, error)) (any, error) {
return nil, errors.New("error")
},
},
@@ -270,7 +270,7 @@ func Test_ert_RoundTrip(t *testing.T) {
},
},
bo: &backoffMock{
- DoFunc: func(ctx context.Context, fn func(context.Context) (interface{}, bool, error)) (interface{}, error) {
+ DoFunc: func(ctx context.Context, fn func(context.Context) (any, bool, error)) (any, error) {
val, _, err := fn(ctx)
return val, err
},
@@ -292,7 +292,7 @@ func Test_ert_RoundTrip(t *testing.T) {
},
},
bo: &backoffMock{
- DoFunc: func(ctx context.Context, fn func(context.Context) (interface{}, bool, error)) (interface{}, error) {
+ DoFunc: func(ctx context.Context, fn func(context.Context) (any, bool, error)) (any, error) {
val, _, err := fn(ctx)
return val, err
},
diff --git a/internal/observability/metrics/agent/sidecar/sidecar.go b/internal/observability/metrics/agent/sidecar/sidecar.go
index d87f2f98c9..5185980eef 100644
--- a/internal/observability/metrics/agent/sidecar/sidecar.go
+++ b/internal/observability/metrics/agent/sidecar/sidecar.go
@@ -148,7 +148,9 @@ func (sm *sidecarMetrics) Register(m metrics.Meter) error {
return err
}
-func (*sidecarMetrics) BeforeProcess(ctx context.Context, _ *observer.BackupInfo) (context.Context, error) {
+func (*sidecarMetrics) BeforeProcess(
+ ctx context.Context, _ *observer.BackupInfo,
+) (context.Context, error) {
return ctx, nil
}
diff --git a/internal/observability/metrics/info/info.go b/internal/observability/metrics/info/info.go
index 3892992c92..1fba9ead3c 100644
--- a/internal/observability/metrics/info/info.go
+++ b/internal/observability/metrics/info/info.go
@@ -32,7 +32,7 @@ type info struct {
}
// New creates new general info metric according to the provided struct.
-func New(name, description string, i interface{}) metrics.Metric {
+func New(name, description string, i any) metrics.Metric {
return &info{
name: name,
description: description,
@@ -40,7 +40,7 @@ func New(name, description string, i interface{}) metrics.Metric {
}
}
-func labelKVs(i interface{}) map[string]string {
+func labelKVs(i any) map[string]string {
rt, rv := reflect.TypeOf(i), reflect.ValueOf(i)
kvs := make(map[string]string, rt.NumField())
for k := 0; k < rt.NumField(); k++ {
diff --git a/internal/observability/metrics/info/info_test.go b/internal/observability/metrics/info/info_test.go
index 590b9c07f9..b6f793f3e2 100644
--- a/internal/observability/metrics/info/info_test.go
+++ b/internal/observability/metrics/info/info_test.go
@@ -19,7 +19,7 @@ package info
// type args struct {
// name string
// description string
-// i interface{}
+// i any
// }
// type want struct {
// want metrics.Metric
@@ -109,7 +109,7 @@ package info
//
// func Test_labelKVs(t *testing.T) {
// type args struct {
-// i interface{}
+// i any
// }
// type want struct {
// want map[string]string
diff --git a/internal/observability/metrics/tools/benchmark/benchmark.go b/internal/observability/metrics/tools/benchmark/benchmark.go
index 370e07cbff..426083996c 100644
--- a/internal/observability/metrics/tools/benchmark/benchmark.go
+++ b/internal/observability/metrics/tools/benchmark/benchmark.go
@@ -43,13 +43,13 @@ const (
completeBenchmarkJobCountDescription = "Benchmark Operator complete benchmark job count"
// appliedJobCount = "benchmark_operator_applied_job"
- // appliedJobCountDescription = "Benchmark Operator applied job count"
+ // appliedJobCountDescription = "Benchmark Operator applied job count".
// runningJobCount = "benchmark_operator_running_job"
- // runningJobCountDescription = "Benchmark Operator running job count"
+ // runningJobCountDescription = "Benchmark Operator running job count".
// completeJobCount = "benchmark_operator_complete_job"
- // completeJobCountDescription = "Benchmark Operator complete job count"
+ // completeJobCountDescription = "Benchmark Operator complete job count".
)
const (
@@ -68,7 +68,7 @@ func New(om service.Operator) metrics.Metric {
}
}
-// TODO: implement here
+// TODO: implement here.
func (om *operatorMetrics) View() ([]metrics.View, error) {
return []metrics.View{
view.NewView(
@@ -128,7 +128,7 @@ func (om *operatorMetrics) View() ([]metrics.View, error) {
}, nil
}
-// TODO: implement here
+// TODO: implement here.
func (om *operatorMetrics) Register(m metrics.Meter) error {
appliedScenarioCount, err := m.Int64ObservableCounter(
appliedScenarioCount,
diff --git a/internal/observability/trace/status.go b/internal/observability/trace/status.go
index 48a9adfd83..dc7390c61d 100644
--- a/internal/observability/trace/status.go
+++ b/internal/observability/trace/status.go
@@ -19,7 +19,7 @@ package trace
import (
"github.com/vdaas/vald/internal/net/grpc/codes"
- "go.opentelemetry.io/otel/attribute"
+ "github.com/vdaas/vald/internal/observability/attribute"
ocodes "go.opentelemetry.io/otel/codes"
semconv "go.opentelemetry.io/otel/semconv/v1.24.0"
)
diff --git a/internal/observability/trace/trace.go b/internal/observability/trace/trace.go
index cc3f42fa5b..71845ab276 100644
--- a/internal/observability/trace/trace.go
+++ b/internal/observability/trace/trace.go
@@ -46,7 +46,9 @@ type Tracer interface {
type tracer struct{}
-func StartSpan(ctx context.Context, name string, opts ...trace.SpanStartOption) (context.Context, Span) {
+func StartSpan(
+ ctx context.Context, name string, opts ...trace.SpanStartOption,
+) (context.Context, Span) {
if !enabled {
return ctx, nil
}
diff --git a/internal/rand/rand.go b/internal/rand/rand.go
index c0db32be03..56cd0c8912 100644
--- a/internal/rand/rand.go
+++ b/internal/rand/rand.go
@@ -29,7 +29,7 @@ type rand struct {
}
var pool = sync.Pool{
- New: func() interface{} {
+ New: func() any {
return (&rand{
x: new(uint32),
}).init()
diff --git a/internal/rand/rand_test.go b/internal/rand/rand_test.go
index 8d9f762e50..7dcd7a3356 100644
--- a/internal/rand/rand_test.go
+++ b/internal/rand/rand_test.go
@@ -25,7 +25,7 @@ import (
func clearPool() {
pool = sync.Pool{
- New: func() interface{} {
+ New: func() any {
return new(rand).init()
},
}
diff --git a/internal/runner/option.go b/internal/runner/option.go
index 603e146e01..17c5dfec6f 100644
--- a/internal/runner/option.go
+++ b/internal/runner/option.go
@@ -45,7 +45,7 @@ func WithVersion(ver, max, min string) Option {
}
}
-func WithConfigLoader(f func(string) (interface{}, *config.GlobalConfig, error)) Option {
+func WithConfigLoader(f func(string) (any, *config.GlobalConfig, error)) Option {
return func(r *runner) {
if f != nil {
r.loadConfig = f
@@ -53,7 +53,7 @@ func WithConfigLoader(f func(string) (interface{}, *config.GlobalConfig, error))
}
}
-func WithDaemonInitializer(f func(interface{}) (Runner, error)) Option {
+func WithDaemonInitializer(f func(any) (Runner, error)) Option {
return func(r *runner) {
if f != nil {
r.initializeDaemon = f
diff --git a/internal/runner/option_test.go b/internal/runner/option_test.go
index b97ba4b8a2..0ede371a3e 100644
--- a/internal/runner/option_test.go
+++ b/internal/runner/option_test.go
@@ -222,7 +222,7 @@ func TestWithVersion(t *testing.T) {
func TestWithConfigLoader(t *testing.T) {
type T = runner
type args struct {
- f func(string) (interface{}, *config.GlobalConfig, error)
+ f func(string) (any, *config.GlobalConfig, error)
}
type want struct {
obj *T
@@ -245,7 +245,7 @@ func TestWithConfigLoader(t *testing.T) {
tests := []test{
func() test {
- f := func(string) (interface{}, *config.GlobalConfig, error) {
+ f := func(string) (any, *config.GlobalConfig, error) {
return nil, nil, nil
}
return test{
@@ -297,7 +297,7 @@ func TestWithConfigLoader(t *testing.T) {
func TestWithDaemonInitializer(t *testing.T) {
type T = runner
type args struct {
- f func(interface{}) (Runner, error)
+ f func(any) (Runner, error)
}
type want struct {
obj *T
@@ -320,7 +320,7 @@ func TestWithDaemonInitializer(t *testing.T) {
tests := []test{
func() test {
- f := func(interface{}) (Runner, error) {
+ f := func(any) (Runner, error) {
return nil, nil
}
return test{
diff --git a/internal/runner/runner.go b/internal/runner/runner.go
index ebd322a536..9caf79535f 100644
--- a/internal/runner/runner.go
+++ b/internal/runner/runner.go
@@ -52,8 +52,8 @@ type runner struct {
maxVersion string
minVersion string
name string
- loadConfig func(string) (interface{}, *config.GlobalConfig, error)
- initializeDaemon func(interface{}) (Runner, error)
+ loadConfig func(string) (any, *config.GlobalConfig, error)
+ initializeDaemon func(any) (Runner, error)
}
func Do(ctx context.Context, opts ...Option) error {
diff --git a/internal/runner/runner_race_test.go b/internal/runner/runner_race_test.go
index 801bc914bc..22dd211a4f 100644
--- a/internal/runner/runner_race_test.go
+++ b/internal/runner/runner_race_test.go
@@ -93,7 +93,7 @@ func TestDo_for_race(t *testing.T) {
args: args{
ctx: context.Background(),
opts: []Option{
- WithConfigLoader(func(string) (interface{}, *config.GlobalConfig, error) {
+ WithConfigLoader(func(string) (any, *config.GlobalConfig, error) {
return nil, nil, errors.New("err")
}),
},
@@ -115,7 +115,7 @@ func TestDo_for_race(t *testing.T) {
ctx: context.Background(),
opts: []Option{
WithVersion("v1.1.7", "v1.1.5", "v1.1.0"),
- WithConfigLoader(func(string) (interface{}, *config.GlobalConfig, error) {
+ WithConfigLoader(func(string) (any, *config.GlobalConfig, error) {
return nil, &config.GlobalConfig{
Logging: &config.Logging{
Logger: "glg",
@@ -144,7 +144,7 @@ func TestDo_for_race(t *testing.T) {
ctx: context.Background(),
opts: []Option{
WithVersion("v1.1.2", "v1.1.5", "v1.1.0"),
- WithConfigLoader(func(string) (interface{}, *config.GlobalConfig, error) {
+ WithConfigLoader(func(string) (any, *config.GlobalConfig, error) {
return nil, &config.GlobalConfig{
Logging: &config.Logging{
Logger: "glg",
@@ -154,7 +154,7 @@ func TestDo_for_race(t *testing.T) {
Version: "v1.1.2",
}, nil
}),
- WithDaemonInitializer(func(interface{}) (Runner, error) {
+ WithDaemonInitializer(func(any) (Runner, error) {
return nil, errors.New("err")
}),
},
@@ -176,7 +176,7 @@ func TestDo_for_race(t *testing.T) {
ctx: context.Background(),
opts: []Option{
WithVersion("v1.1.2", "v1.1.5", "v1.1.0"),
- WithConfigLoader(func(string) (interface{}, *config.GlobalConfig, error) {
+ WithConfigLoader(func(string) (any, *config.GlobalConfig, error) {
return nil, &config.GlobalConfig{
Logging: &config.Logging{
Logger: "glg",
@@ -186,7 +186,7 @@ func TestDo_for_race(t *testing.T) {
Version: "v1.1.2",
}, nil
}),
- WithDaemonInitializer(func(interface{}) (Runner, error) {
+ WithDaemonInitializer(func(any) (Runner, error) {
return &runnerMock{
PreStartFunc: func(ctx context.Context) error {
return nil
diff --git a/internal/servers/servers_mock.go b/internal/servers/servers_mock.go
index cada14bd20..f37a08ce9d 100644
--- a/internal/servers/servers_mock.go
+++ b/internal/servers/servers_mock.go
@@ -13,9 +13,7 @@
// limitations under the License.
package servers
-import (
- "context"
-)
+import "context"
type mockServer struct {
NameFunc func() string
diff --git a/internal/strings/strings.go b/internal/strings/strings.go
index 69b970e093..7eeafe2f7e 100644
--- a/internal/strings/strings.go
+++ b/internal/strings/strings.go
@@ -81,7 +81,7 @@ var (
NewReplacer = strings.NewReplacer
bufferPool = sync.Pool{
- New: func() interface{} {
+ New: func() any {
return bytes.NewBuffer(make([]byte, 0, syscall.Getpagesize()))
},
}
diff --git a/internal/sync/singleflight/singleflight.go b/internal/sync/singleflight/singleflight.go
index 13d2ada450..d3305fab9f 100644
--- a/internal/sync/singleflight/singleflight.go
+++ b/internal/sync/singleflight/singleflight.go
@@ -112,7 +112,9 @@ func New[V any]() Group[V] {
// time. If a duplicate comes in, the duplicate caller waits for the
// original to complete and receives the same results.
// The return value shared indicates whether v was given to multiple callers.
-func (g *group[V]) Do(ctx context.Context, key string, fn func(context.Context) (V, error)) (v V, shared bool, err error) {
+func (g *group[V]) Do(
+ ctx context.Context, key string, fn func(context.Context) (V, error),
+) (v V, shared bool, err error) {
g.mu.Lock()
if g.m == nil {
g.m = make(map[string]*call[V])
@@ -142,7 +144,9 @@ func (g *group[V]) Do(ctx context.Context, key string, fn func(context.Context)
// results when they are ready.
//
// The returned channel will not be closed.
-func (g *group[V]) DoChan(ctx context.Context, key string, fn func(context.Context) (V, error)) <-chan Result[V] {
+func (g *group[V]) DoChan(
+ ctx context.Context, key string, fn func(context.Context) (V, error),
+) <-chan Result[V] {
ch := make(chan Result[V])
g.mu.Lock()
if g.m == nil {
@@ -165,7 +169,9 @@ func (g *group[V]) DoChan(ctx context.Context, key string, fn func(context.Conte
}
// doCall handles the single call for a key.
-func (g *group[V]) doCall(ctx context.Context, c *call[V], key string, fn func(ctx context.Context) (V, error)) {
+func (g *group[V]) doCall(
+ ctx context.Context, c *call[V], key string, fn func(ctx context.Context) (V, error),
+) {
normalReturn := false
recovered := false
diff --git a/internal/sync/singleflight/singleflight_test.go b/internal/sync/singleflight/singleflight_test.go
index 021933f2b8..b6921c9e55 100644
--- a/internal/sync/singleflight/singleflight_test.go
+++ b/internal/sync/singleflight/singleflight_test.go
@@ -472,7 +472,7 @@ func TestPanicDo(t *testing.T) {
func TestGoexitDo(t *testing.T) {
g := New[any]()
- fn := func(context.Context) (interface{}, error) {
+ fn := func(context.Context) (any, error) {
runtime.Goexit()
return nil, nil
}
@@ -527,7 +527,7 @@ func TestPanicDoChan(t *testing.T) {
}()
g := New[any]()
- ch := g.DoChan(context.Background(), "", func(context.Context) (interface{}, error) {
+ ch := g.DoChan(context.Background(), "", func(context.Context) (any, error) {
panic("Panicking in DoChan")
})
<-ch
@@ -568,7 +568,7 @@ func TestPanicDoSharedByDoChan(t *testing.T) {
defer func() {
recover()
}()
- g.Do(context.Background(), "", func(context.Context) (interface{}, error) {
+ g.Do(context.Background(), "", func(context.Context) (any, error) {
close(blocked)
<-unblock
panic("Panicking in Do")
@@ -576,7 +576,7 @@ func TestPanicDoSharedByDoChan(t *testing.T) {
}()
<-blocked
- ch := g.DoChan(context.Background(), "", func(context.Context) (interface{}, error) {
+ ch := g.DoChan(context.Background(), "", func(context.Context) (any, error) {
panic("DoChan unexpectedly executed callback")
})
close(unblock)
diff --git a/internal/test/data/hdf5/option.go b/internal/test/data/hdf5/option.go
index ac2f9a3a24..e847b09805 100644
--- a/internal/test/data/hdf5/option.go
+++ b/internal/test/data/hdf5/option.go
@@ -17,9 +17,7 @@
// Package hdf5 is load hdf5 file
package hdf5
-import (
- "github.com/vdaas/vald/internal/errors"
-)
+import "github.com/vdaas/vald/internal/errors"
type Option func(d *data) error
diff --git a/internal/test/data/hdf5/option_test.go b/internal/test/data/hdf5/option_test.go
index 5453a71665..6d68d44f03 100644
--- a/internal/test/data/hdf5/option_test.go
+++ b/internal/test/data/hdf5/option_test.go
@@ -128,7 +128,7 @@ func TestWithNameByString(t *testing.T) {
func TestWithName(t *testing.T) {
// Change interface type to the type of object you are testing
- type T = interface{}
+ type T = any
type args struct {
dn DatasetName
}
@@ -258,7 +258,7 @@ func TestWithName(t *testing.T) {
func TestWithFilePath(t *testing.T) {
// Change interface type to the type of object you are testing
- type T = interface{}
+ type T = any
type args struct {
f string
}
diff --git a/internal/test/data/request/insert.go b/internal/test/data/request/insert.go
index bb5f0cd0e0..6d6b4f142c 100644
--- a/internal/test/data/request/insert.go
+++ b/internal/test/data/request/insert.go
@@ -27,7 +27,9 @@ const (
Float
)
-func GenMultiInsertReq(t ObjectType, dist vector.Distribution, num int, dim int, cfg *payload.Insert_Config) (*payload.Insert_MultiRequest, error) {
+func GenMultiInsertReq(
+ t ObjectType, dist vector.Distribution, num int, dim int, cfg *payload.Insert_Config,
+) (*payload.Insert_MultiRequest, error) {
var vecs [][]float32
var err error
switch t {
@@ -57,7 +59,9 @@ func GenMultiInsertReq(t ObjectType, dist vector.Distribution, num int, dim int,
}
// GenSameVecMultiInsertReq generates Insert_MultiRequest with the same vector.
-func GenSameVecMultiInsertReq(num int, vec []float32, cfg *payload.Insert_Config) *payload.Insert_MultiRequest {
+func GenSameVecMultiInsertReq(
+ num int, vec []float32, cfg *payload.Insert_Config,
+) *payload.Insert_MultiRequest {
req := &payload.Insert_MultiRequest{
Requests: make([]*payload.Insert_Request, num),
}
diff --git a/internal/test/mock/client/mirror_client_mock.go b/internal/test/mock/client/mirror_client_mock.go
index 96baff34be..ec0e075298 100644
--- a/internal/test/mock/client/mirror_client_mock.go
+++ b/internal/test/mock/client/mirror_client_mock.go
@@ -33,22 +33,32 @@ type MirrorClientMock struct {
RemoveByTimestampFunc func(ctx context.Context, in *payload.Remove_TimestampRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error)
}
-func (mc *MirrorClientMock) Insert(ctx context.Context, in *payload.Insert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) {
+func (mc *MirrorClientMock) Insert(
+ ctx context.Context, in *payload.Insert_Request, opts ...grpc.CallOption,
+) (*payload.Object_Location, error) {
return mc.InsertFunc(ctx, in, opts...)
}
-func (mc *MirrorClientMock) Update(ctx context.Context, in *payload.Update_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) {
+func (mc *MirrorClientMock) Update(
+ ctx context.Context, in *payload.Update_Request, opts ...grpc.CallOption,
+) (*payload.Object_Location, error) {
return mc.UpdateFunc(ctx, in, opts...)
}
-func (mc *MirrorClientMock) Upsert(ctx context.Context, in *payload.Upsert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) {
+func (mc *MirrorClientMock) Upsert(
+ ctx context.Context, in *payload.Upsert_Request, opts ...grpc.CallOption,
+) (*payload.Object_Location, error) {
return mc.UpsertFunc(ctx, in, opts...)
}
-func (mc *MirrorClientMock) Remove(ctx context.Context, in *payload.Remove_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) {
+func (mc *MirrorClientMock) Remove(
+ ctx context.Context, in *payload.Remove_Request, opts ...grpc.CallOption,
+) (*payload.Object_Location, error) {
return mc.RemoveFunc(ctx, in, opts...)
}
-func (mc *MirrorClientMock) RemoveByTimestamp(ctx context.Context, in *payload.Remove_TimestampRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) {
+func (mc *MirrorClientMock) RemoveByTimestamp(
+ ctx context.Context, in *payload.Remove_TimestampRequest, opts ...grpc.CallOption,
+) (*payload.Object_Locations, error) {
return mc.RemoveByTimestampFunc(ctx, in, opts...)
}
diff --git a/internal/test/mock/controller_runtime.go b/internal/test/mock/controller_runtime.go
index b8bd60fd1c..7ec38894a4 100644
--- a/internal/test/mock/controller_runtime.go
+++ b/internal/test/mock/controller_runtime.go
@@ -24,7 +24,9 @@ type MockSubResourceWriter struct {
client.SubResourceWriter
}
-func (*MockSubResourceWriter) Update(context.Context, client.Object, ...client.SubResourceUpdateOption) error {
+func (*MockSubResourceWriter) Update(
+ context.Context, client.Object, ...client.SubResourceUpdateOption,
+) error {
return nil
}
@@ -39,7 +41,9 @@ func (*MockClient) Status() client.SubResourceWriter {
return s.SubResourceWriter
}
-func (*MockClient) Get(context.Context, client.ObjectKey, client.Object, ...client.GetOption) error {
+func (*MockClient) Get(
+ context.Context, client.ObjectKey, client.Object, ...client.GetOption,
+) error {
return nil
}
diff --git a/internal/test/mock/grpc/grpc_client_mock.go b/internal/test/mock/grpc/grpc_client_mock.go
index 8d83768dac..e29fc50c5d 100644
--- a/internal/test/mock/grpc/grpc_client_mock.go
+++ b/internal/test/mock/grpc/grpc_client_mock.go
@@ -37,7 +37,8 @@ type GRPCClientMock struct {
}
// OrderedRangeConcurrent calls the OrderedRangeConcurrentFunc object.
-func (gc *GRPCClientMock) OrderedRangeConcurrent(ctx context.Context,
+func (gc *GRPCClientMock) OrderedRangeConcurrent(
+ ctx context.Context,
order []string,
concurrency int,
f func(ctx context.Context,
@@ -54,7 +55,9 @@ func (gc *GRPCClientMock) ConnectedAddrs() []string {
}
// Connect calls the ConnectFunc object.
-func (gc *GRPCClientMock) Connect(ctx context.Context, addr string, dopts ...grpc.DialOption) (pool.Conn, error) {
+func (gc *GRPCClientMock) Connect(
+ ctx context.Context, addr string, dopts ...grpc.DialOption,
+) (pool.Conn, error) {
return gc.ConnectFunc(ctx, addr, dopts...)
}
diff --git a/internal/test/mock/grpc_testify_mock.go b/internal/test/mock/grpc_testify_mock.go
index 858a5819a4..c853f27d4e 100644
--- a/internal/test/mock/grpc_testify_mock.go
+++ b/internal/test/mock/grpc_testify_mock.go
@@ -31,7 +31,7 @@ type ServerStreamTestifyMock struct {
mock.Mock
}
-func (*ServerStreamTestifyMock) SendMsg(_ interface{}) error {
+func (*ServerStreamTestifyMock) SendMsg(_ any) error {
return nil
}
@@ -50,11 +50,11 @@ func (*ServerStreamTestifyMock) Context() context.Context {
return context.Background()
}
-func (*ServerStreamTestifyMock) SendMsgWithContext(_ context.Context, _ interface{}) error {
+func (*ServerStreamTestifyMock) SendMsgWithContext(_ context.Context, _ any) error {
return nil
}
-func (*ServerStreamTestifyMock) RecvMsg(_ interface{}) error {
+func (*ServerStreamTestifyMock) RecvMsg(_ any) error {
return nil
}
@@ -83,7 +83,9 @@ func (c *ClientInternal) StartConnectionMonitor(ctx context.Context) (<-chan err
return args.Get(0).(<-chan error), args.Error(1)
}
-func (c *ClientInternal) Connect(ctx context.Context, addr string, dopts ...DialOption) (pool.Conn, error) {
+func (c *ClientInternal) Connect(
+ ctx context.Context, addr string, dopts ...DialOption,
+) (pool.Conn, error) {
args := c.Called(ctx, addr, dopts)
return args.Get(0).(pool.Conn), args.Error(1)
}
@@ -98,7 +100,8 @@ func (c *ClientInternal) Disconnect(ctx context.Context, addr string) error {
return args.Error(0)
}
-func (c *ClientInternal) Range(ctx context.Context,
+func (c *ClientInternal) Range(
+ ctx context.Context,
f func(ctx context.Context,
addr string,
conn *ClientConn,
@@ -108,7 +111,8 @@ func (c *ClientInternal) Range(ctx context.Context,
return args.Error(0)
}
-func (c *ClientInternal) RangeConcurrent(ctx context.Context,
+func (c *ClientInternal) RangeConcurrent(
+ ctx context.Context,
concurrency int,
f func(ctx context.Context,
addr string,
@@ -119,7 +123,8 @@ func (c *ClientInternal) RangeConcurrent(ctx context.Context,
return args.Error(0)
}
-func (c *ClientInternal) OrderedRange(ctx context.Context,
+func (c *ClientInternal) OrderedRange(
+ ctx context.Context,
order []string,
f func(ctx context.Context,
addr string,
@@ -130,7 +135,8 @@ func (c *ClientInternal) OrderedRange(ctx context.Context,
return args.Error(0)
}
-func (c *ClientInternal) OrderedRangeConcurrent(ctx context.Context,
+func (c *ClientInternal) OrderedRangeConcurrent(
+ ctx context.Context,
order []string,
concurrency int,
f func(ctx context.Context,
@@ -142,19 +148,23 @@ func (c *ClientInternal) OrderedRangeConcurrent(ctx context.Context,
return args.Error(0)
}
-func (c *ClientInternal) Do(ctx context.Context, addr string,
+func (c *ClientInternal) Do(
+ ctx context.Context,
+ addr string,
f func(ctx context.Context,
conn *ClientConn,
- copts ...CallOption) (interface{}, error),
-) (interface{}, error) {
+ copts ...CallOption) (any, error),
+) (any, error) {
args := c.Called(ctx, addr, f)
return args.Get(0), args.Error(1)
}
-func (c *ClientInternal) RoundRobin(ctx context.Context, f func(ctx context.Context,
- conn *ClientConn,
- copts ...CallOption) (interface{}, error),
-) (interface{}, error) {
+func (c *ClientInternal) RoundRobin(
+ ctx context.Context,
+ f func(ctx context.Context,
+ conn *ClientConn,
+ copts ...CallOption) (any, error),
+) (any, error) {
args := c.Called(ctx, f)
return args.Get(0), args.Error(1)
}
diff --git a/internal/test/mock/k8s/client.go b/internal/test/mock/k8s/client.go
index 9a3c628ccb..dfce1c16b9 100644
--- a/internal/test/mock/k8s/client.go
+++ b/internal/test/mock/k8s/client.go
@@ -31,37 +31,51 @@ type ValdK8sClientMock struct {
var _ client.Client = (*ValdK8sClientMock)(nil)
-func (m *ValdK8sClientMock) Get(ctx context.Context, name, namespace string, obj k8s.Object, opts ...crclient.GetOption) error {
+func (m *ValdK8sClientMock) Get(
+ ctx context.Context, name, namespace string, obj k8s.Object, opts ...crclient.GetOption,
+) error {
args := m.Called(ctx, name, namespace, obj, opts)
return args.Error(0)
}
-func (m *ValdK8sClientMock) List(ctx context.Context, list crclient.ObjectList, opts ...k8s.ListOption) error {
+func (m *ValdK8sClientMock) List(
+ ctx context.Context, list crclient.ObjectList, opts ...k8s.ListOption,
+) error {
args := m.Called(ctx, list, opts)
return args.Error(0)
}
-func (m *ValdK8sClientMock) Create(ctx context.Context, obj k8s.Object, opts ...k8s.CreateOption) error {
+func (m *ValdK8sClientMock) Create(
+ ctx context.Context, obj k8s.Object, opts ...k8s.CreateOption,
+) error {
args := m.Called(ctx, obj, opts)
return args.Error(0)
}
-func (m *ValdK8sClientMock) Delete(ctx context.Context, obj k8s.Object, opts ...crclient.DeleteOption) error {
+func (m *ValdK8sClientMock) Delete(
+ ctx context.Context, obj k8s.Object, opts ...crclient.DeleteOption,
+) error {
args := m.Called(ctx, obj, opts)
return args.Error(0)
}
-func (m *ValdK8sClientMock) Update(ctx context.Context, obj k8s.Object, opts ...crclient.UpdateOption) error {
+func (m *ValdK8sClientMock) Update(
+ ctx context.Context, obj k8s.Object, opts ...crclient.UpdateOption,
+) error {
args := m.Called(ctx, obj, opts)
return args.Error(0)
}
-func (m *ValdK8sClientMock) Patch(ctx context.Context, obj k8s.Object, patch crclient.Patch, opts ...crclient.PatchOption) error {
+func (m *ValdK8sClientMock) Patch(
+ ctx context.Context, obj k8s.Object, patch crclient.Patch, opts ...crclient.PatchOption,
+) error {
args := m.Called(ctx, obj, patch, opts)
return args.Error(0)
}
-func (m *ValdK8sClientMock) Watch(ctx context.Context, obj crclient.ObjectList, opts ...k8s.ListOption) (watch.Interface, error) {
+func (m *ValdK8sClientMock) Watch(
+ ctx context.Context, obj crclient.ObjectList, opts ...k8s.ListOption,
+) (watch.Interface, error) {
args := m.Called(ctx, obj, opts)
return args.Get(0).(watch.Interface), args.Error(1)
}
@@ -71,7 +85,9 @@ func (m *ValdK8sClientMock) MatchingLabels(labels map[string]string) k8s.Matchin
return args.Get(0).(k8s.MatchingLabels)
}
-func (m *ValdK8sClientMock) LabelSelector(key string, op selection.Operator, vals []string) (labels.Selector, error) {
+func (m *ValdK8sClientMock) LabelSelector(
+ key string, op selection.Operator, vals []string,
+) (labels.Selector, error) {
args := m.Called(key, op, vals)
return args.Get(0).(labels.Selector), args.Error(1)
}
@@ -82,7 +98,9 @@ type PatcherMock struct {
var _ client.Patcher = (*PatcherMock)(nil)
-func (m *PatcherMock) ApplyPodAnnotations(ctx context.Context, name, namespace string, entries map[string]string) error {
+func (m *PatcherMock) ApplyPodAnnotations(
+ ctx context.Context, name, namespace string, entries map[string]string,
+) error {
args := m.Called(ctx, name, namespace, entries)
return args.Error(0)
}
diff --git a/internal/test/mock/k8s/controller_runtime.go b/internal/test/mock/k8s/controller_runtime.go
index c08fec5414..039f1945ad 100644
--- a/internal/test/mock/k8s/controller_runtime.go
+++ b/internal/test/mock/k8s/controller_runtime.go
@@ -26,7 +26,9 @@ type SubResourceWriterMock struct {
UpdateFunc func(context.Context, client.Object, ...client.SubResourceUpdateOption) error
}
-func (sm *SubResourceWriterMock) Update(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error {
+func (sm *SubResourceWriterMock) Update(
+ ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption,
+) error {
return sm.UpdateFunc(ctx, obj, opts...)
}
@@ -44,19 +46,27 @@ func (cm *ClientMock) Status() client.SubResourceWriter {
return cm.StatusFunc()
}
-func (cm *ClientMock) Get(ctx context.Context, objKey client.ObjectKey, obj client.Object, opts ...client.GetOption) error {
+func (cm *ClientMock) Get(
+ ctx context.Context, objKey client.ObjectKey, obj client.Object, opts ...client.GetOption,
+) error {
return cm.GetFunc(ctx, objKey, obj, opts...)
}
-func (cm *ClientMock) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error {
+func (cm *ClientMock) Create(
+ ctx context.Context, obj client.Object, opts ...client.CreateOption,
+) error {
return cm.CreateFunc(ctx, obj, opts...)
}
-func (cm *ClientMock) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error {
+func (cm *ClientMock) Delete(
+ ctx context.Context, obj client.Object, opts ...client.DeleteOption,
+) error {
return cm.DeleteFunc(ctx, obj, opts...)
}
-func (cm *ClientMock) DeleteAllOf(ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error {
+func (cm *ClientMock) DeleteAllOf(
+ ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption,
+) error {
return cm.DeleteAllOfFunc(ctx, obj, opts...)
}
diff --git a/internal/test/mock/server_stream.go b/internal/test/mock/server_stream.go
index b9051179d9..2e4c2abcc8 100644
--- a/internal/test/mock/server_stream.go
+++ b/internal/test/mock/server_stream.go
@@ -41,8 +41,8 @@ type ServerStreamMock struct {
SendHeaderFunc func(metadata.MD) error
SetTrailerFunc func(metadata.MD)
ContextFunc func() context.Context
- SendMsgFunc func(interface{}) error
- RecvMsgFunc func(interface{}) error
+ SendMsgFunc func(any) error
+ RecvMsgFunc func(any) error
}
func (m *ServerStreamMock) SetHeader(md metadata.MD) error {
@@ -61,10 +61,10 @@ func (m *ServerStreamMock) Context() context.Context {
return m.ContextFunc()
}
-func (m *ServerStreamMock) SendMsg(msg interface{}) error {
+func (m *ServerStreamMock) SendMsg(msg any) error {
return m.SendMsgFunc(msg)
}
-func (m *ServerStreamMock) RecvMsg(msg interface{}) error {
+func (m *ServerStreamMock) RecvMsg(msg any) error {
return m.RecvMsgFunc(msg)
}
diff --git a/internal/test/testify/testify.go b/internal/test/testify/testify.go
index 4b85ddaa71..5c6c5896ce 100644
--- a/internal/test/testify/testify.go
+++ b/internal/test/testify/testify.go
@@ -13,9 +13,7 @@
// limitations under the License.
package testify
-import (
- "github.com/stretchr/testify/mock"
-)
+import "github.com/stretchr/testify/mock"
type (
Arguments = mock.Arguments
diff --git a/internal/timeutil/location/loc.go b/internal/timeutil/location/loc.go
index ea22a48300..4b79670e46 100644
--- a/internal/timeutil/location/loc.go
+++ b/internal/timeutil/location/loc.go
@@ -13,9 +13,7 @@
// limitations under the License.
package location
-import (
- "time"
-)
+import "time"
const (
locationTokyo = "Asia/Tokyo"
diff --git a/internal/timeutil/location/loc_bench_test.go b/internal/timeutil/location/loc_bench_test.go
index 2754ef2bc4..756fce782e 100644
--- a/internal/timeutil/location/loc_bench_test.go
+++ b/internal/timeutil/location/loc_bench_test.go
@@ -13,9 +13,7 @@
// limitations under the License.
package location
-import (
- "testing"
-)
+import "testing"
func BenchmarkGMT(b *testing.B) {
b.ReportAllocs()
diff --git a/internal/tls/tls.go b/internal/tls/tls.go
index d33f32f1d3..64811db689 100644
--- a/internal/tls/tls.go
+++ b/internal/tls/tls.go
@@ -110,14 +110,14 @@ func NewX509CertPool(path string) (pool *x509.CertPool, err error) {
if err != nil || c == nil {
return nil, err
}
- if err == nil && c != nil {
- pool, err = x509.SystemCertPool()
- if err != nil || pool == nil {
- pool = x509.NewCertPool()
- }
- if !pool.AppendCertsFromPEM(c) {
- err = errors.ErrCertificationFailed
- }
+
+ pool, err = x509.SystemCertPool()
+ if err != nil || pool == nil {
+ pool = x509.NewCertPool()
+ }
+
+ if !pool.AppendCertsFromPEM(c) {
+ err = errors.ErrCertificationFailed
}
return pool, err
}
diff --git a/internal/worker/worker_option.go b/internal/worker/worker_option.go
index 872e75dc0e..4c203a9f6e 100644
--- a/internal/worker/worker_option.go
+++ b/internal/worker/worker_option.go
@@ -17,9 +17,7 @@
// Package worker provides worker processes
package worker
-import (
- "github.com/vdaas/vald/internal/sync/errgroup"
-)
+import "github.com/vdaas/vald/internal/sync/errgroup"
type WorkerOption func(w *worker) error
diff --git a/k8s/operator/helm/operator.yaml b/k8s/operator/helm/operator.yaml
index a3447788f0..6742640aea 100644
--- a/k8s/operator/helm/operator.yaml
+++ b/k8s/operator/helm/operator.yaml
@@ -45,8 +45,6 @@ spec:
image: "vdaas/vald-helm-operator:v1.7.12"
imagePullPolicy: Always
args:
- - "run"
- - "--watches-file=./watches.yaml"
- "--leader-elect"
- "--leader-election-id=vald-helm-operator"
- "--leader-election-namespace=default"
diff --git a/pkg/agent/core/faiss/handler/grpc/flush.go b/pkg/agent/core/faiss/handler/grpc/flush.go
index dbaef33c9c..1298565351 100644
--- a/pkg/agent/core/faiss/handler/grpc/flush.go
+++ b/pkg/agent/core/faiss/handler/grpc/flush.go
@@ -19,7 +19,9 @@ import (
"github.com/vdaas/vald/apis/grpc/v1/payload"
)
-// TODO: implement Flush Handler
-func (s *server) Flush(ctx context.Context, req *payload.Flush_Request) (*payload.Info_Index_Count, error) {
+// TODO: implement Flush Handler.
+func (s *server) Flush(
+ ctx context.Context, req *payload.Flush_Request,
+) (*payload.Info_Index_Count, error) {
return s.UnimplementedValdServer.UnimplementedFlushServer.Flush(ctx, req)
}
diff --git a/pkg/agent/core/faiss/handler/grpc/index.go b/pkg/agent/core/faiss/handler/grpc/index.go
index 03d5eb2813..b12c0ed3c8 100644
--- a/pkg/agent/core/faiss/handler/grpc/index.go
+++ b/pkg/agent/core/faiss/handler/grpc/index.go
@@ -29,7 +29,9 @@ import (
"github.com/vdaas/vald/internal/observability/trace"
)
-func (s *server) CreateIndex(ctx context.Context, c *payload.Control_CreateIndexRequest) (res *payload.Empty, err error) {
+func (s *server) CreateIndex(
+ ctx context.Context, c *payload.Control_CreateIndexRequest,
+) (res *payload.Empty, err error) {
ctx, span := trace.StartSpan(ctx, apiName+".CreateIndex")
defer func() {
if span != nil {
@@ -110,7 +112,9 @@ func (s *server) SaveIndex(ctx context.Context, _ *payload.Empty) (res *payload.
return res, nil
}
-func (s *server) CreateAndSaveIndex(ctx context.Context, c *payload.Control_CreateIndexRequest) (res *payload.Empty, err error) {
+func (s *server) CreateAndSaveIndex(
+ ctx context.Context, c *payload.Control_CreateIndexRequest,
+) (res *payload.Empty, err error) {
ctx, span := trace.StartSpan(ctx, apiName+".CreateAndSaveIndex")
defer func() {
if span != nil {
@@ -163,7 +167,9 @@ func (s *server) CreateAndSaveIndex(ctx context.Context, c *payload.Control_Crea
return res, nil
}
-func (s *server) IndexInfo(ctx context.Context, c *payload.Empty) (res *payload.Info_Index_Count, err error) {
+func (s *server) IndexInfo(
+ ctx context.Context, c *payload.Empty,
+) (res *payload.Info_Index_Count, err error) {
_, span := trace.StartSpan(ctx, apiName+".IndexInfo")
defer func() {
if span != nil {
diff --git a/pkg/agent/core/faiss/handler/grpc/insert.go b/pkg/agent/core/faiss/handler/grpc/insert.go
index 356afc0632..f975178d6d 100644
--- a/pkg/agent/core/faiss/handler/grpc/insert.go
+++ b/pkg/agent/core/faiss/handler/grpc/insert.go
@@ -28,11 +28,13 @@ import (
"github.com/vdaas/vald/internal/net/grpc/codes"
"github.com/vdaas/vald/internal/net/grpc/errdetails"
"github.com/vdaas/vald/internal/net/grpc/status"
+ "github.com/vdaas/vald/internal/observability/attribute"
"github.com/vdaas/vald/internal/observability/trace"
- "go.opentelemetry.io/otel/attribute"
)
-func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (res *payload.Object_Location, err error) {
+func (s *server) Insert(
+ ctx context.Context, req *payload.Insert_Request,
+) (res *payload.Object_Location, err error) {
_, span := trace.StartSpan(ctx, apiName+"/"+vald.InsertRPCName)
defer func() {
if span != nil {
@@ -136,6 +138,8 @@ func (s *server) StreamInsert(stream vald.Insert_StreamInsertServer) (err error)
return s.UnimplementedValdServer.UnimplementedInsertServer.StreamInsert(stream)
}
-func (s *server) MultiInsert(ctx context.Context, reqs *payload.Insert_MultiRequest) (res *payload.Object_Locations, err error) {
+func (s *server) MultiInsert(
+ ctx context.Context, reqs *payload.Insert_MultiRequest,
+) (res *payload.Object_Locations, err error) {
return s.UnimplementedValdServer.UnimplementedInsertServer.MultiInsert(ctx, reqs)
}
diff --git a/pkg/agent/core/faiss/handler/grpc/linear_search.go b/pkg/agent/core/faiss/handler/grpc/linear_search.go
index b871582f28..b48573b775 100644
--- a/pkg/agent/core/faiss/handler/grpc/linear_search.go
+++ b/pkg/agent/core/faiss/handler/grpc/linear_search.go
@@ -23,11 +23,15 @@ import (
"github.com/vdaas/vald/apis/grpc/v1/vald"
)
-func (s *server) LinearSearch(ctx context.Context, req *payload.Search_Request) (res *payload.Search_Response, err error) {
+func (s *server) LinearSearch(
+ ctx context.Context, req *payload.Search_Request,
+) (res *payload.Search_Response, err error) {
return s.UnimplementedValdServer.UnimplementedSearchServer.LinearSearch(ctx, req)
}
-func (s *server) LinearSearchByID(ctx context.Context, req *payload.Search_IDRequest) (res *payload.Search_Response, err error) {
+func (s *server) LinearSearchByID(
+ ctx context.Context, req *payload.Search_IDRequest,
+) (res *payload.Search_Response, err error) {
return s.UnimplementedValdServer.UnimplementedSearchServer.LinearSearchByID(ctx, req)
}
@@ -35,14 +39,20 @@ func (s *server) StreamLinearSearch(stream vald.Search_StreamLinearSearchServer)
return s.UnimplementedValdServer.UnimplementedSearchServer.StreamLinearSearch(stream)
}
-func (s *server) StreamLinearSearchByID(stream vald.Search_StreamLinearSearchByIDServer) (err error) {
+func (s *server) StreamLinearSearchByID(
+ stream vald.Search_StreamLinearSearchByIDServer,
+) (err error) {
return s.UnimplementedValdServer.UnimplementedSearchServer.StreamLinearSearchByID(stream)
}
-func (s *server) MultiLinearSearch(ctx context.Context, reqs *payload.Search_MultiRequest) (res *payload.Search_Responses, errs error) {
+func (s *server) MultiLinearSearch(
+ ctx context.Context, reqs *payload.Search_MultiRequest,
+) (res *payload.Search_Responses, errs error) {
return s.UnimplementedValdServer.UnimplementedSearchServer.MultiLinearSearch(ctx, reqs)
}
-func (s *server) MultiLinearSearchByID(ctx context.Context, reqs *payload.Search_MultiIDRequest) (res *payload.Search_Responses, errs error) {
+func (s *server) MultiLinearSearchByID(
+ ctx context.Context, reqs *payload.Search_MultiIDRequest,
+) (res *payload.Search_Responses, errs error) {
return s.UnimplementedValdServer.UnimplementedSearchServer.MultiLinearSearchByID(ctx, reqs)
}
diff --git a/pkg/agent/core/faiss/handler/grpc/object.go b/pkg/agent/core/faiss/handler/grpc/object.go
index ff5d43596f..a8cb4529c0 100644
--- a/pkg/agent/core/faiss/handler/grpc/object.go
+++ b/pkg/agent/core/faiss/handler/grpc/object.go
@@ -29,7 +29,9 @@ import (
"github.com/vdaas/vald/internal/observability/trace"
)
-func (s *server) Exists(ctx context.Context, uid *payload.Object_ID) (res *payload.Object_ID, err error) {
+func (s *server) Exists(
+ ctx context.Context, uid *payload.Object_ID,
+) (res *payload.Object_ID, err error) {
_, span := trace.StartSpan(ctx, apiName+"/"+vald.ExistsRPCName)
defer func() {
if span != nil {
@@ -87,7 +89,9 @@ func (s *server) Exists(ctx context.Context, uid *payload.Object_ID) (res *paylo
return uid, nil
}
-func (s *server) GetObject(ctx context.Context, id *payload.Object_VectorRequest) (res *payload.Object_Vector, err error) {
+func (s *server) GetObject(
+ ctx context.Context, id *payload.Object_VectorRequest,
+) (res *payload.Object_Vector, err error) {
return s.UnimplementedValdServer.UnimplementedObjectServer.GetObject(ctx, id)
}
diff --git a/pkg/agent/core/faiss/handler/grpc/remove.go b/pkg/agent/core/faiss/handler/grpc/remove.go
index 9cbaea4496..a2f0e31d15 100644
--- a/pkg/agent/core/faiss/handler/grpc/remove.go
+++ b/pkg/agent/core/faiss/handler/grpc/remove.go
@@ -27,11 +27,13 @@ import (
"github.com/vdaas/vald/internal/log"
"github.com/vdaas/vald/internal/net/grpc/errdetails"
"github.com/vdaas/vald/internal/net/grpc/status"
+ "github.com/vdaas/vald/internal/observability/attribute"
"github.com/vdaas/vald/internal/observability/trace"
- "go.opentelemetry.io/otel/attribute"
)
-func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (res *payload.Object_Location, err error) {
+func (s *server) Remove(
+ ctx context.Context, req *payload.Remove_Request,
+) (res *payload.Object_Location, err error) {
_, span := trace.StartSpan(ctx, apiName+"/"+vald.RemoveRPCName)
defer func() {
if span != nil {
@@ -129,6 +131,8 @@ func (s *server) StreamRemove(stream vald.Remove_StreamRemoveServer) (err error)
return s.UnimplementedValdServer.UnimplementedRemoveServer.StreamRemove(stream)
}
-func (s *server) MultiRemove(ctx context.Context, reqs *payload.Remove_MultiRequest) (res *payload.Object_Locations, err error) {
+func (s *server) MultiRemove(
+ ctx context.Context, reqs *payload.Remove_MultiRequest,
+) (res *payload.Object_Locations, err error) {
return s.UnimplementedValdServer.UnimplementedRemoveServer.MultiRemove(ctx, reqs)
}
diff --git a/pkg/agent/core/faiss/handler/grpc/search.go b/pkg/agent/core/faiss/handler/grpc/search.go
index bbe5a45c4d..4cbc224384 100644
--- a/pkg/agent/core/faiss/handler/grpc/search.go
+++ b/pkg/agent/core/faiss/handler/grpc/search.go
@@ -27,11 +27,13 @@ import (
"github.com/vdaas/vald/internal/log"
"github.com/vdaas/vald/internal/net/grpc/errdetails"
"github.com/vdaas/vald/internal/net/grpc/status"
+ "github.com/vdaas/vald/internal/observability/attribute"
"github.com/vdaas/vald/internal/observability/trace"
- "go.opentelemetry.io/otel/attribute"
)
-func (s *server) Search(ctx context.Context, req *payload.Search_Request) (res *payload.Search_Response, err error) {
+func (s *server) Search(
+ ctx context.Context, req *payload.Search_Request,
+) (res *payload.Search_Response, err error) {
_, span := trace.StartSpan(ctx, apiName+"/"+vald.SearchRPCName)
defer func() {
if span != nil {
@@ -158,7 +160,9 @@ func (s *server) Search(ctx context.Context, req *payload.Search_Request) (res *
return res, nil
}
-func (s *server) SearchByID(ctx context.Context, req *payload.Search_IDRequest) (res *payload.Search_Response, err error) {
+func (s *server) SearchByID(
+ ctx context.Context, req *payload.Search_IDRequest,
+) (res *payload.Search_Response, err error) {
return s.UnimplementedValdServer.UnimplementedSearchServer.SearchByID(ctx, req)
}
@@ -170,10 +174,14 @@ func (s *server) StreamSearchByID(stream vald.Search_StreamSearchByIDServer) (er
return s.UnimplementedValdServer.UnimplementedSearchServer.StreamSearchByID(stream)
}
-func (s *server) MultiSearch(ctx context.Context, reqs *payload.Search_MultiRequest) (res *payload.Search_Responses, errs error) {
+func (s *server) MultiSearch(
+ ctx context.Context, reqs *payload.Search_MultiRequest,
+) (res *payload.Search_Responses, errs error) {
return s.UnimplementedValdServer.UnimplementedSearchServer.MultiSearch(ctx, reqs)
}
-func (s *server) MultiSearchByID(ctx context.Context, reqs *payload.Search_MultiIDRequest) (res *payload.Search_Responses, errs error) {
+func (s *server) MultiSearchByID(
+ ctx context.Context, reqs *payload.Search_MultiIDRequest,
+) (res *payload.Search_Responses, errs error) {
return s.UnimplementedValdServer.UnimplementedSearchServer.MultiSearchByID(ctx, reqs)
}
diff --git a/pkg/agent/core/faiss/handler/grpc/update.go b/pkg/agent/core/faiss/handler/grpc/update.go
index ca5b4f371d..da7d95edc6 100644
--- a/pkg/agent/core/faiss/handler/grpc/update.go
+++ b/pkg/agent/core/faiss/handler/grpc/update.go
@@ -27,11 +27,13 @@ import (
"github.com/vdaas/vald/internal/log"
"github.com/vdaas/vald/internal/net/grpc/errdetails"
"github.com/vdaas/vald/internal/net/grpc/status"
+ "github.com/vdaas/vald/internal/observability/attribute"
"github.com/vdaas/vald/internal/observability/trace"
- "go.opentelemetry.io/otel/attribute"
)
-func (s *server) Update(ctx context.Context, req *payload.Update_Request) (res *payload.Object_Location, err error) {
+func (s *server) Update(
+ ctx context.Context, req *payload.Update_Request,
+) (res *payload.Object_Location, err error) {
_, span := trace.StartSpan(ctx, apiName+"/"+vald.UpdateRPCName)
defer func() {
if span != nil {
@@ -168,6 +170,8 @@ func (s *server) StreamUpdate(stream vald.Update_StreamUpdateServer) (err error)
return s.UnimplementedValdServer.UnimplementedUpdateServer.StreamUpdate(stream)
}
-func (s *server) MultiUpdate(ctx context.Context, reqs *payload.Update_MultiRequest) (res *payload.Object_Locations, err error) {
+func (s *server) MultiUpdate(
+ ctx context.Context, reqs *payload.Update_MultiRequest,
+) (res *payload.Object_Locations, err error) {
return s.UnimplementedValdServer.UnimplementedUpdateServer.MultiUpdate(ctx, reqs)
}
diff --git a/pkg/agent/core/faiss/handler/grpc/upsert.go b/pkg/agent/core/faiss/handler/grpc/upsert.go
index 38675e58c9..1d78d7a7d4 100644
--- a/pkg/agent/core/faiss/handler/grpc/upsert.go
+++ b/pkg/agent/core/faiss/handler/grpc/upsert.go
@@ -23,7 +23,9 @@ import (
"github.com/vdaas/vald/apis/grpc/v1/vald"
)
-func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc *payload.Object_Location, err error) {
+func (s *server) Upsert(
+ ctx context.Context, req *payload.Upsert_Request,
+) (loc *payload.Object_Location, err error) {
return s.UnimplementedValdServer.UnimplementedUpsertServer.Upsert(ctx, req)
}
@@ -31,6 +33,8 @@ func (s *server) StreamUpsert(stream vald.Upsert_StreamUpsertServer) (err error)
return s.UnimplementedValdServer.UnimplementedUpsertServer.StreamUpsert(stream)
}
-func (s *server) MultiUpsert(ctx context.Context, reqs *payload.Upsert_MultiRequest) (res *payload.Object_Locations, err error) {
+func (s *server) MultiUpsert(
+ ctx context.Context, reqs *payload.Upsert_MultiRequest,
+) (res *payload.Object_Locations, err error) {
return s.UnimplementedValdServer.UnimplementedUpsertServer.MultiUpsert(ctx, reqs)
}
diff --git a/pkg/agent/core/faiss/handler/rest/handler.go b/pkg/agent/core/faiss/handler/rest/handler.go
index 108e808715..ef1c80bab9 100644
--- a/pkg/agent/core/faiss/handler/rest/handler.go
+++ b/pkg/agent/core/faiss/handler/rest/handler.go
@@ -59,99 +59,99 @@ func New(opts ...Option) Handler {
}
func (h *handler) Index(w http.ResponseWriter, r *http.Request) (int, error) {
- data := make(map[string]interface{})
- return json.Handler(w, r, &data, func() (interface{}, error) {
+ data := make(map[string]any)
+ return json.Handler(w, r, &data, func() (any, error) {
return dump.Request(nil, data, r)
})
}
func (h *handler) Search(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.agent.Search(r.Context(), req)
})
}
func (h *handler) SearchByID(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_IDRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.agent.SearchByID(r.Context(), req)
})
}
func (h *handler) LinearSearch(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.agent.LinearSearch(r.Context(), req)
})
}
func (h *handler) LinearSearchByID(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_IDRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.agent.LinearSearchByID(r.Context(), req)
})
}
func (h *handler) Insert(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Insert_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.agent.Insert(r.Context(), req)
})
}
func (h *handler) MultiInsert(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Insert_MultiRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.agent.MultiInsert(r.Context(), req)
})
}
func (h *handler) Update(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Update_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.agent.Update(r.Context(), req)
})
}
func (h *handler) MultiUpdate(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Update_MultiRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.agent.MultiUpdate(r.Context(), req)
})
}
func (h *handler) Remove(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Remove_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.agent.Remove(r.Context(), req)
})
}
func (h *handler) MultiRemove(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Remove_MultiRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.agent.MultiRemove(r.Context(), req)
})
}
func (h *handler) CreateIndex(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Control_CreateIndexRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.agent.CreateIndex(r.Context(), req)
})
}
func (h *handler) SaveIndex(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Empty
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.agent.SaveIndex(r.Context(), req)
})
}
func (h *handler) CreateAndSaveIndex(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Control_CreateIndexRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
_, err = h.agent.CreateIndex(r.Context(), req)
if err != nil {
return nil, err
@@ -162,14 +162,14 @@ func (h *handler) CreateAndSaveIndex(w http.ResponseWriter, r *http.Request) (co
func (h *handler) GetObject(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Object_VectorRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.agent.GetObject(r.Context(), req)
})
}
func (h *handler) Exists(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Object_ID
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.agent.Exists(r.Context(), req)
})
}
diff --git a/pkg/agent/core/faiss/service/faiss.go b/pkg/agent/core/faiss/service/faiss.go
index 3f8a85c744..a5b11e4f7c 100644
--- a/pkg/agent/core/faiss/service/faiss.go
+++ b/pkg/agent/core/faiss/service/faiss.go
@@ -1270,7 +1270,9 @@ func (f *faiss) Close(ctx context.Context) error {
return nil
}
-func (f *faiss) toSearchResponse(sr []algorithm.SearchResult) (res *payload.Search_Response, err error) {
+func (f *faiss) toSearchResponse(
+ sr []algorithm.SearchResult,
+) (res *payload.Search_Response, err error) {
if len(sr) == 0 {
if f.Len() == 0 {
return nil, nil
diff --git a/pkg/agent/core/ngt/handler/grpc/flush.go b/pkg/agent/core/ngt/handler/grpc/flush.go
index cdba112896..a622b1d47e 100644
--- a/pkg/agent/core/ngt/handler/grpc/flush.go
+++ b/pkg/agent/core/ngt/handler/grpc/flush.go
@@ -25,12 +25,14 @@ import (
"github.com/vdaas/vald/internal/log"
"github.com/vdaas/vald/internal/net/grpc/errdetails"
"github.com/vdaas/vald/internal/net/grpc/status"
+ "github.com/vdaas/vald/internal/observability/attribute"
"github.com/vdaas/vald/internal/observability/trace"
- "go.opentelemetry.io/otel/attribute"
)
// Flush removes all vectors that are indexed and uncommitted in the `vald-agent`.
-func (s *server) Flush(ctx context.Context, req *payload.Flush_Request) (*payload.Info_Index_Count, error) {
+func (s *server) Flush(
+ ctx context.Context, req *payload.Flush_Request,
+) (*payload.Info_Index_Count, error) {
_, span := trace.StartSpan(ctx, apiName+"/"+vald.FlushRPCName)
defer func() {
if span != nil {
@@ -84,19 +86,19 @@ func (s *server) Flush(ctx context.Context, req *payload.Flush_Request) (*payloa
}
var (
- stored uint32
- uncommited uint32
- indexing atomic.Value
- saving atomic.Value
+ stored uint32
+ uncommitted uint32
+ indexing atomic.Value
+ saving atomic.Value
)
stored = 0
- uncommited = 0
+ uncommitted = 0
indexing.Store(false)
saving.Store(false)
cnts := &payload.Info_Index_Count{
Stored: atomic.LoadUint32(&stored),
- Uncommitted: atomic.LoadUint32(&uncommited),
+ Uncommitted: atomic.LoadUint32(&uncommitted),
Indexing: indexing.Load().(bool),
Saving: saving.Load().(bool),
}
diff --git a/pkg/agent/core/ngt/handler/grpc/handler_test.go b/pkg/agent/core/ngt/handler/grpc/handler_test.go
index e6efdfaf75..78cdd63e52 100644
--- a/pkg/agent/core/ngt/handler/grpc/handler_test.go
+++ b/pkg/agent/core/ngt/handler/grpc/handler_test.go
@@ -39,8 +39,17 @@ func TestMain(m *testing.M) {
goleak.VerifyTestMain(m)
}
-func newIndexedNGTService(ctx context.Context, eg errgroup.Group, t request.ObjectType, dist vector.Distribution, num int, insertCfg *payload.Insert_Config,
- ngtCfg *config.NGT, ngtOpts []service.Option, overwriteIDs []string, overwriteVectors [][]float32,
+func newIndexedNGTService(
+ ctx context.Context,
+ eg errgroup.Group,
+ t request.ObjectType,
+ dist vector.Distribution,
+ num int,
+ insertCfg *payload.Insert_Config,
+ ngtCfg *config.NGT,
+ ngtOpts []service.Option,
+ overwriteIDs []string,
+ overwriteVectors [][]float32,
) (service.NGT, error) {
ngt, err := service.New(ngtCfg, append(ngtOpts, service.WithErrGroup(eg), service.WithEnableInMemoryMode(true))...)
if err != nil {
diff --git a/pkg/agent/core/ngt/handler/grpc/index.go b/pkg/agent/core/ngt/handler/grpc/index.go
index 7641446500..439c382133 100644
--- a/pkg/agent/core/ngt/handler/grpc/index.go
+++ b/pkg/agent/core/ngt/handler/grpc/index.go
@@ -27,7 +27,9 @@ import (
"github.com/vdaas/vald/internal/observability/trace"
)
-func (s *server) CreateIndex(ctx context.Context, c *payload.Control_CreateIndexRequest) (res *payload.Empty, err error) {
+func (s *server) CreateIndex(
+ ctx context.Context, c *payload.Control_CreateIndexRequest,
+) (res *payload.Empty, err error) {
ctx, span := trace.StartSpan(ctx, apiName+".CreateIndex")
defer func() {
if span != nil {
@@ -39,7 +41,7 @@ func (s *server) CreateIndex(ctx context.Context, c *payload.Control_CreateIndex
if err != nil {
var (
code codes.Code
- details = []interface{}{
+ details = []any{
&errdetails.RequestInfo{
ServingData: errdetails.Serialize(c),
},
@@ -110,7 +112,9 @@ func (s *server) SaveIndex(ctx context.Context, _ *payload.Empty) (res *payload.
return res, nil
}
-func (s *server) CreateAndSaveIndex(ctx context.Context, c *payload.Control_CreateIndexRequest) (res *payload.Empty, err error) {
+func (s *server) CreateAndSaveIndex(
+ ctx context.Context, c *payload.Control_CreateIndexRequest,
+) (res *payload.Empty, err error) {
ctx, span := trace.StartSpan(ctx, apiName+".CreateAndSaveIndex")
defer func() {
if span != nil {
@@ -122,7 +126,7 @@ func (s *server) CreateAndSaveIndex(ctx context.Context, c *payload.Control_Crea
if err != nil {
var (
code codes.Code
- details = []interface{}{
+ details = []any{
&errdetails.RequestInfo{
ServingData: errdetails.Serialize(c),
},
@@ -165,7 +169,9 @@ func (s *server) CreateAndSaveIndex(ctx context.Context, c *payload.Control_Crea
return res, nil
}
-func (s *server) IndexInfo(ctx context.Context, _ *payload.Empty) (res *payload.Info_Index_Count, err error) {
+func (s *server) IndexInfo(
+ ctx context.Context, _ *payload.Empty,
+) (res *payload.Info_Index_Count, err error) {
_, span := trace.StartSpan(ctx, apiName+".IndexInfo")
defer func() {
if span != nil {
@@ -179,3 +185,26 @@ func (s *server) IndexInfo(ctx context.Context, _ *payload.Empty) (res *payload.
Saving: s.ngt.IsSaving(),
}, nil
}
+
+func (s *server) IndexDetail(
+ ctx context.Context, _ *payload.Empty,
+) (res *payload.Info_Index_Detail, err error) {
+ _, span := trace.StartSpan(ctx, apiName+".IndexDetail")
+ defer func() {
+ if span != nil {
+ span.End()
+ }
+ }()
+ res = &payload.Info_Index_Detail{
+ Counts: make(map[string]*payload.Info_Index_Count),
+ Replica: 1,
+ LiveAgents: 1,
+ }
+ res.Counts[s.name] = &payload.Info_Index_Count{
+ Stored: uint32(s.ngt.Len()),
+ Uncommitted: uint32(s.ngt.InsertVQueueBufferLen() + s.ngt.DeleteVQueueBufferLen()),
+ Indexing: s.ngt.IsIndexing(),
+ Saving: s.ngt.IsSaving(),
+ }
+ return res, nil
+}
diff --git a/pkg/agent/core/ngt/handler/grpc/insert.go b/pkg/agent/core/ngt/handler/grpc/insert.go
index d4be3907c9..ed46791b4e 100644
--- a/pkg/agent/core/ngt/handler/grpc/insert.go
+++ b/pkg/agent/core/ngt/handler/grpc/insert.go
@@ -26,13 +26,15 @@ import (
"github.com/vdaas/vald/internal/net/grpc/codes"
"github.com/vdaas/vald/internal/net/grpc/errdetails"
"github.com/vdaas/vald/internal/net/grpc/status"
+ "github.com/vdaas/vald/internal/observability/attribute"
"github.com/vdaas/vald/internal/observability/trace"
"github.com/vdaas/vald/internal/strings"
- "go.opentelemetry.io/otel/attribute"
)
// Insert inserts a vector to the NGT.
-func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (res *payload.Object_Location, err error) {
+func (s *server) Insert(
+ ctx context.Context, req *payload.Insert_Request,
+) (res *payload.Object_Location, err error) {
_, span := trace.StartSpan(ctx, apiName+"/"+vald.InsertRPCName)
defer func() {
if span != nil {
@@ -190,7 +192,9 @@ func (s *server) StreamInsert(stream vald.Insert_StreamInsertServer) (err error)
return nil
}
-func (s *server) MultiInsert(ctx context.Context, reqs *payload.Insert_MultiRequest) (res *payload.Object_Locations, err error) {
+func (s *server) MultiInsert(
+ ctx context.Context, reqs *payload.Insert_MultiRequest,
+) (res *payload.Object_Locations, err error) {
_, span := trace.StartSpan(ctx, apiName+"/"+vald.MultiInsertRPCName)
defer func() {
if span != nil {
diff --git a/pkg/agent/core/ngt/handler/grpc/insert_test.go b/pkg/agent/core/ngt/handler/grpc/insert_test.go
index 1bb8f4af41..fa223ca69d 100644
--- a/pkg/agent/core/ngt/handler/grpc/insert_test.go
+++ b/pkg/agent/core/ngt/handler/grpc/insert_test.go
@@ -2654,7 +2654,7 @@ func Test_server_StreamInsert(t *testing.T) {
ContextFunc: func() context.Context {
return ctx
},
- RecvMsgFunc: func(i interface{}) error {
+ RecvMsgFunc: func(i any) error {
if recvIdx >= len(insertReqs) {
return io.EOF
}
@@ -2668,7 +2668,7 @@ func Test_server_StreamInsert(t *testing.T) {
return nil
},
- SendMsgFunc: func(i interface{}) error {
+ SendMsgFunc: func(i any) error {
rpcResp = append(rpcResp, i.(*payload.Object_StreamLocation))
return nil
},
diff --git a/pkg/agent/core/ngt/handler/grpc/linear_search.go b/pkg/agent/core/ngt/handler/grpc/linear_search.go
index abe0d374cd..1c13861428 100644
--- a/pkg/agent/core/ngt/handler/grpc/linear_search.go
+++ b/pkg/agent/core/ngt/handler/grpc/linear_search.go
@@ -26,14 +26,16 @@ import (
"github.com/vdaas/vald/internal/net/grpc/codes"
"github.com/vdaas/vald/internal/net/grpc/errdetails"
"github.com/vdaas/vald/internal/net/grpc/status"
+ "github.com/vdaas/vald/internal/observability/attribute"
"github.com/vdaas/vald/internal/observability/trace"
"github.com/vdaas/vald/internal/safety"
"github.com/vdaas/vald/internal/strings"
"github.com/vdaas/vald/internal/sync"
- "go.opentelemetry.io/otel/attribute"
)
-func (s *server) LinearSearch(ctx context.Context, req *payload.Search_Request) (res *payload.Search_Response, err error) {
+func (s *server) LinearSearch(
+ ctx context.Context, req *payload.Search_Request,
+) (res *payload.Search_Response, err error) {
ctx, span := trace.StartSpan(ctx, apiName+"/"+vald.LinearSearchRPCName)
defer func() {
if span != nil {
@@ -171,7 +173,9 @@ func (s *server) LinearSearch(ctx context.Context, req *payload.Search_Request)
return res, nil
}
-func (s *server) LinearSearchByID(ctx context.Context, req *payload.Search_IDRequest) (res *payload.Search_Response, err error) {
+func (s *server) LinearSearchByID(
+ ctx context.Context, req *payload.Search_IDRequest,
+) (res *payload.Search_Response, err error) {
ctx, span := trace.StartSpan(ctx, apiName+"/"+vald.LinearSearchByIDRPCName)
defer func() {
if span != nil {
@@ -371,7 +375,9 @@ func (s *server) StreamLinearSearch(stream vald.Search_StreamLinearSearchServer)
return nil
}
-func (s *server) StreamLinearSearchByID(stream vald.Search_StreamLinearSearchByIDServer) (err error) {
+func (s *server) StreamLinearSearchByID(
+ stream vald.Search_StreamLinearSearchByIDServer,
+) (err error) {
ctx, span := trace.StartSpan(stream.Context(), apiName+"/"+vald.StreamLinearSearchByIDRPCName)
defer func() {
if span != nil {
@@ -418,7 +424,9 @@ func (s *server) StreamLinearSearchByID(stream vald.Search_StreamLinearSearchByI
return nil
}
-func (s *server) MultiLinearSearch(ctx context.Context, reqs *payload.Search_MultiRequest) (res *payload.Search_Responses, errs error) {
+func (s *server) MultiLinearSearch(
+ ctx context.Context, reqs *payload.Search_MultiRequest,
+) (res *payload.Search_Responses, errs error) {
ctx, span := trace.StartSpan(ctx, apiName+"/"+vald.MultiLinearSearchRPCName)
defer func() {
if span != nil {
@@ -492,7 +500,9 @@ func (s *server) MultiLinearSearch(ctx context.Context, reqs *payload.Search_Mul
return res, nil
}
-func (s *server) MultiLinearSearchByID(ctx context.Context, reqs *payload.Search_MultiIDRequest) (res *payload.Search_Responses, errs error) {
+func (s *server) MultiLinearSearchByID(
+ ctx context.Context, reqs *payload.Search_MultiIDRequest,
+) (res *payload.Search_Responses, errs error) {
ctx, span := trace.StartSpan(ctx, apiName+"/"+vald.MultiLinearSearchByIDRPCName)
defer func() {
if span != nil {
diff --git a/pkg/agent/core/ngt/handler/grpc/object.go b/pkg/agent/core/ngt/handler/grpc/object.go
index ea7ec38b3d..e55c19963b 100644
--- a/pkg/agent/core/ngt/handler/grpc/object.go
+++ b/pkg/agent/core/ngt/handler/grpc/object.go
@@ -29,7 +29,9 @@ import (
"github.com/vdaas/vald/internal/sync"
)
-func (s *server) Exists(ctx context.Context, uid *payload.Object_ID) (res *payload.Object_ID, err error) {
+func (s *server) Exists(
+ ctx context.Context, uid *payload.Object_ID,
+) (res *payload.Object_ID, err error) {
_, span := trace.StartSpan(ctx, apiName+"/"+vald.ExistsRPCName)
defer func() {
if span != nil {
@@ -77,7 +79,9 @@ func (s *server) Exists(ctx context.Context, uid *payload.Object_ID) (res *paylo
return uid, nil
}
-func (s *server) GetObject(ctx context.Context, id *payload.Object_VectorRequest) (res *payload.Object_Vector, err error) {
+func (s *server) GetObject(
+ ctx context.Context, id *payload.Object_VectorRequest,
+) (res *payload.Object_Vector, err error) {
_, span := trace.StartSpan(ctx, apiName+"/"+vald.GetObjectRPCName)
defer func() {
if span != nil {
@@ -179,7 +183,9 @@ func (s *server) StreamGetObject(stream vald.Object_StreamGetObjectServer) (err
return nil
}
-func (s *server) StreamListObject(_ *payload.Object_List_Request, stream vald.Object_StreamListObjectServer) (err error) {
+func (s *server) StreamListObject(
+ _ *payload.Object_List_Request, stream vald.Object_StreamListObjectServer,
+) (err error) {
ctx, span := trace.StartSpan(stream.Context(), apiName+"/"+vald.StreamListObjectRPCName)
defer func() {
if span != nil {
@@ -255,7 +261,9 @@ func (s *server) StreamListObject(_ *payload.Object_List_Request, stream vald.Ob
// GetTimestamp returns meta information of the object specified by uuid.
// This rpc is only served in AgentServer and not served in LB. Only for internal use mainly for index correction to reduce
// network bandwidth(because vector itself is not required for index correction logic) while processing.
-func (s *server) GetTimestamp(ctx context.Context, id *payload.Object_GetTimestampRequest) (res *payload.Object_Timestamp, err error) {
+func (s *server) GetTimestamp(
+ ctx context.Context, id *payload.Object_TimestampRequest,
+) (res *payload.Object_Timestamp, err error) {
_, span := trace.StartSpan(ctx, apiName+"/"+vald.GetTimestampRPCName)
defer func() {
if span != nil {
diff --git a/pkg/agent/core/ngt/handler/grpc/object_test.go b/pkg/agent/core/ngt/handler/grpc/object_test.go
index f4f3f25699..743736f435 100644
--- a/pkg/agent/core/ngt/handler/grpc/object_test.go
+++ b/pkg/agent/core/ngt/handler/grpc/object_test.go
@@ -1401,7 +1401,7 @@ func Test_server_GetTimestamp(t *testing.T) {
// now test if the timestamp can be returned correctly
for i := 0; i < num; i++ {
testvec := req.GetRequests()[i].GetVector()
- res, err := s.GetTimestamp(ectx, &payload.Object_GetTimestampRequest{
+ res, err := s.GetTimestamp(ectx, &payload.Object_TimestampRequest{
Id: &payload.Object_ID{
Id: testvec.GetId(),
},
@@ -1417,7 +1417,7 @@ func Test_server_GetTimestamp(t *testing.T) {
eg, ectx, s := setup(t)
defer eg.Wait()
- _, err := s.GetTimestamp(ectx, &payload.Object_GetTimestampRequest{
+ _, err := s.GetTimestamp(ectx, &payload.Object_TimestampRequest{
Id: &payload.Object_ID{
Id: "",
},
@@ -1431,7 +1431,7 @@ func Test_server_GetTimestamp(t *testing.T) {
eg, ectx, s := setup(t)
defer eg.Wait()
- _, err := s.GetTimestamp(ectx, &payload.Object_GetTimestampRequest{
+ _, err := s.GetTimestamp(ectx, &payload.Object_TimestampRequest{
Id: &payload.Object_ID{
Id: "not exist ID",
},
diff --git a/pkg/agent/core/ngt/handler/grpc/remove.go b/pkg/agent/core/ngt/handler/grpc/remove.go
index f57685bbb1..b246b2434c 100644
--- a/pkg/agent/core/ngt/handler/grpc/remove.go
+++ b/pkg/agent/core/ngt/handler/grpc/remove.go
@@ -26,13 +26,15 @@ import (
"github.com/vdaas/vald/internal/net/grpc/codes"
"github.com/vdaas/vald/internal/net/grpc/errdetails"
"github.com/vdaas/vald/internal/net/grpc/status"
+ "github.com/vdaas/vald/internal/observability/attribute"
"github.com/vdaas/vald/internal/observability/trace"
"github.com/vdaas/vald/internal/strings"
"github.com/vdaas/vald/internal/sync"
- "go.opentelemetry.io/otel/attribute"
)
-func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (res *payload.Object_Location, err error) {
+func (s *server) Remove(
+ ctx context.Context, req *payload.Remove_Request,
+) (res *payload.Object_Location, err error) {
_, span := trace.StartSpan(ctx, apiName+"/"+vald.RemoveRPCName)
defer func() {
if span != nil {
@@ -185,7 +187,9 @@ func (s *server) StreamRemove(stream vald.Remove_StreamRemoveServer) (err error)
return nil
}
-func (s *server) MultiRemove(ctx context.Context, reqs *payload.Remove_MultiRequest) (res *payload.Object_Locations, err error) {
+func (s *server) MultiRemove(
+ ctx context.Context, reqs *payload.Remove_MultiRequest,
+) (res *payload.Object_Locations, err error) {
_, span := trace.StartSpan(ctx, apiName+"/"+vald.MultiRemoveRPCName)
defer func() {
if span != nil {
@@ -274,7 +278,9 @@ func (s *server) MultiRemove(ctx context.Context, reqs *payload.Remove_MultiRequ
return s.newLocations(uuids...), nil
}
-func (s *server) RemoveByTimestamp(ctx context.Context, req *payload.Remove_TimestampRequest) (locs *payload.Object_Locations, errs error) {
+func (s *server) RemoveByTimestamp(
+ ctx context.Context, req *payload.Remove_TimestampRequest,
+) (locs *payload.Object_Locations, errs error) {
ctx, span := trace.StartSpan(ctx, apiName+"/"+vald.RemoveByTimestampRPCName)
defer func() {
if span != nil {
diff --git a/pkg/agent/core/ngt/handler/grpc/search.go b/pkg/agent/core/ngt/handler/grpc/search.go
index 3c0e43dc84..6543fd9ced 100644
--- a/pkg/agent/core/ngt/handler/grpc/search.go
+++ b/pkg/agent/core/ngt/handler/grpc/search.go
@@ -26,14 +26,16 @@ import (
"github.com/vdaas/vald/internal/net/grpc/codes"
"github.com/vdaas/vald/internal/net/grpc/errdetails"
"github.com/vdaas/vald/internal/net/grpc/status"
+ "github.com/vdaas/vald/internal/observability/attribute"
"github.com/vdaas/vald/internal/observability/trace"
"github.com/vdaas/vald/internal/safety"
"github.com/vdaas/vald/internal/strings"
"github.com/vdaas/vald/internal/sync"
- "go.opentelemetry.io/otel/attribute"
)
-func (s *server) Search(ctx context.Context, req *payload.Search_Request) (res *payload.Search_Response, err error) {
+func (s *server) Search(
+ ctx context.Context, req *payload.Search_Request,
+) (res *payload.Search_Response, err error) {
_, span := trace.StartSpan(ctx, apiName+"/"+vald.SearchRPCName)
defer func() {
if span != nil {
@@ -173,7 +175,9 @@ func (s *server) Search(ctx context.Context, req *payload.Search_Request) (res *
return res, nil
}
-func (s *server) SearchByID(ctx context.Context, req *payload.Search_IDRequest) (res *payload.Search_Response, err error) {
+func (s *server) SearchByID(
+ ctx context.Context, req *payload.Search_IDRequest,
+) (res *payload.Search_Response, err error) {
_, span := trace.StartSpan(ctx, apiName+"/"+vald.SearchByIDRPCName)
defer func() {
if span != nil {
@@ -422,7 +426,9 @@ func (s *server) StreamSearchByID(stream vald.Search_StreamSearchByIDServer) (er
return nil
}
-func (s *server) MultiSearch(ctx context.Context, reqs *payload.Search_MultiRequest) (res *payload.Search_Responses, errs error) {
+func (s *server) MultiSearch(
+ ctx context.Context, reqs *payload.Search_MultiRequest,
+) (res *payload.Search_Responses, errs error) {
ctx, span := trace.StartSpan(ctx, apiName+"/"+vald.MultiSearchRPCName)
defer func() {
if span != nil {
@@ -496,7 +502,9 @@ func (s *server) MultiSearch(ctx context.Context, reqs *payload.Search_MultiRequ
return res, nil
}
-func (s *server) MultiSearchByID(ctx context.Context, reqs *payload.Search_MultiIDRequest) (res *payload.Search_Responses, errs error) {
+func (s *server) MultiSearchByID(
+ ctx context.Context, reqs *payload.Search_MultiIDRequest,
+) (res *payload.Search_Responses, errs error) {
ctx, span := trace.StartSpan(ctx, apiName+"/"+vald.MultiSearchByIDRPCName)
defer func() {
if span != nil {
diff --git a/pkg/agent/core/ngt/handler/grpc/update.go b/pkg/agent/core/ngt/handler/grpc/update.go
index 0a76d7395f..b650c15e83 100644
--- a/pkg/agent/core/ngt/handler/grpc/update.go
+++ b/pkg/agent/core/ngt/handler/grpc/update.go
@@ -26,12 +26,14 @@ import (
"github.com/vdaas/vald/internal/net/grpc/codes"
"github.com/vdaas/vald/internal/net/grpc/errdetails"
"github.com/vdaas/vald/internal/net/grpc/status"
+ "github.com/vdaas/vald/internal/observability/attribute"
"github.com/vdaas/vald/internal/observability/trace"
"github.com/vdaas/vald/internal/strings"
- "go.opentelemetry.io/otel/attribute"
)
-func (s *server) Update(ctx context.Context, req *payload.Update_Request) (res *payload.Object_Location, err error) {
+func (s *server) Update(
+ ctx context.Context, req *payload.Update_Request,
+) (res *payload.Object_Location, err error) {
_, span := trace.StartSpan(ctx, apiName+"/"+vald.UpdateRPCName)
defer func() {
if span != nil {
@@ -219,7 +221,9 @@ func (s *server) StreamUpdate(stream vald.Update_StreamUpdateServer) (err error)
return nil
}
-func (s *server) MultiUpdate(ctx context.Context, reqs *payload.Update_MultiRequest) (res *payload.Object_Locations, err error) {
+func (s *server) MultiUpdate(
+ ctx context.Context, reqs *payload.Update_MultiRequest,
+) (res *payload.Object_Locations, err error) {
_, span := trace.StartSpan(ctx, apiName+"/"+vald.MultiUpdateRPCName)
defer func() {
if span != nil {
diff --git a/pkg/agent/core/ngt/handler/grpc/upsert.go b/pkg/agent/core/ngt/handler/grpc/upsert.go
index e1b39609dc..9bf49a2ea4 100644
--- a/pkg/agent/core/ngt/handler/grpc/upsert.go
+++ b/pkg/agent/core/ngt/handler/grpc/upsert.go
@@ -32,7 +32,9 @@ import (
"github.com/vdaas/vald/internal/sync"
)
-func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc *payload.Object_Location, err error) {
+func (s *server) Upsert(
+ ctx context.Context, req *payload.Upsert_Request,
+) (loc *payload.Object_Location, err error) {
ctx, span := trace.StartSpan(ctx, apiName+"/"+vald.UpsertRPCName)
defer func() {
if span != nil {
@@ -180,7 +182,9 @@ func (s *server) StreamUpsert(stream vald.Upsert_StreamUpsertServer) (err error)
return nil
}
-func (s *server) MultiUpsert(ctx context.Context, reqs *payload.Upsert_MultiRequest) (res *payload.Object_Locations, err error) {
+func (s *server) MultiUpsert(
+ ctx context.Context, reqs *payload.Upsert_MultiRequest,
+) (res *payload.Object_Locations, err error) {
ctx, span := trace.StartSpan(ctx, apiName+"/"+vald.MultiUpsertRPCName)
defer func() {
if span != nil {
diff --git a/pkg/agent/core/ngt/handler/rest/handler.go b/pkg/agent/core/ngt/handler/rest/handler.go
index b6594a2b49..310bbb2fd7 100644
--- a/pkg/agent/core/ngt/handler/rest/handler.go
+++ b/pkg/agent/core/ngt/handler/rest/handler.go
@@ -59,99 +59,99 @@ func New(opts ...Option) Handler {
}
func (*handler) Index(w http.ResponseWriter, r *http.Request) (int, error) {
- data := make(map[string]interface{})
- return json.Handler(w, r, &data, func() (interface{}, error) {
+ data := make(map[string]any)
+ return json.Handler(w, r, &data, func() (any, error) {
return dump.Request(nil, data, r)
})
}
func (h *handler) Search(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.agent.Search(r.Context(), req)
})
}
func (h *handler) SearchByID(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_IDRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.agent.SearchByID(r.Context(), req)
})
}
func (h *handler) LinearSearch(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.agent.LinearSearch(r.Context(), req)
})
}
func (h *handler) LinearSearchByID(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_IDRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.agent.LinearSearchByID(r.Context(), req)
})
}
func (h *handler) Insert(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Insert_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.agent.Insert(r.Context(), req)
})
}
func (h *handler) MultiInsert(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Insert_MultiRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.agent.MultiInsert(r.Context(), req)
})
}
func (h *handler) Update(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Update_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.agent.Update(r.Context(), req)
})
}
func (h *handler) MultiUpdate(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Update_MultiRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.agent.MultiUpdate(r.Context(), req)
})
}
func (h *handler) Remove(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Remove_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.agent.Remove(r.Context(), req)
})
}
func (h *handler) MultiRemove(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Remove_MultiRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.agent.MultiRemove(r.Context(), req)
})
}
func (h *handler) CreateIndex(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Control_CreateIndexRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.agent.CreateIndex(r.Context(), req)
})
}
func (h *handler) SaveIndex(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Empty
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.agent.SaveIndex(r.Context(), req)
})
}
func (h *handler) CreateAndSaveIndex(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Control_CreateIndexRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
_, err = h.agent.CreateIndex(r.Context(), req)
if err != nil {
return nil, err
@@ -162,14 +162,14 @@ func (h *handler) CreateAndSaveIndex(w http.ResponseWriter, r *http.Request) (co
func (h *handler) GetObject(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Object_VectorRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.agent.GetObject(r.Context(), req)
})
}
func (h *handler) Exists(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Object_ID
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.agent.Exists(r.Context(), req)
})
}
diff --git a/pkg/agent/core/ngt/service/ngt.go b/pkg/agent/core/ngt/service/ngt.go
index f1e1a80902..dfeed90d5b 100644
--- a/pkg/agent/core/ngt/service/ngt.go
+++ b/pkg/agent/core/ngt/service/ngt.go
@@ -177,7 +177,7 @@ const (
lastTimeSaveIndexTimestampAnnotationsKey = "vald.vdaas.org/last-time-save-index-timestamp"
indexCountAnnotationsKey = "vald.vdaas.org/index-count"
- // use this only for tests. usually just leave the ctx value empty and let time.Now() be used
+ // use this only for tests. usually just leave the ctx value empty and let time.Now() be used.
saveIndexTimeKey contextSaveIndexTimeKey = "saveIndexTimeKey"
)
@@ -924,7 +924,9 @@ func (n *ngt) Start(ctx context.Context) <-chan error {
return ech
}
-func (n *ngt) Search(ctx context.Context, vec []float32, size uint32, epsilon, radius float32) (res *payload.Search_Response, err error) {
+func (n *ngt) Search(
+ ctx context.Context, vec []float32, size uint32, epsilon, radius float32,
+) (res *payload.Search_Response, err error) {
if n.IsFlushing() {
return nil, errors.ErrFlushingIsInProgress
}
@@ -946,7 +948,9 @@ func (n *ngt) Search(ctx context.Context, vec []float32, size uint32, epsilon, r
return n.toSearchResponse(sr)
}
-func (n *ngt) SearchByID(ctx context.Context, uuid string, size uint32, epsilon, radius float32) (vec []float32, dst *payload.Search_Response, err error) {
+func (n *ngt) SearchByID(
+ ctx context.Context, uuid string, size uint32, epsilon, radius float32,
+) (vec []float32, dst *payload.Search_Response, err error) {
if n.IsFlushing() {
return nil, nil, errors.ErrFlushingIsInProgress
}
@@ -964,7 +968,9 @@ func (n *ngt) SearchByID(ctx context.Context, uuid string, size uint32, epsilon,
return vec, dst, nil
}
-func (n *ngt) LinearSearch(ctx context.Context, vec []float32, size uint32) (res *payload.Search_Response, err error) {
+func (n *ngt) LinearSearch(
+ ctx context.Context, vec []float32, size uint32,
+) (res *payload.Search_Response, err error) {
if n.IsFlushing() {
return nil, errors.ErrFlushingIsInProgress
}
@@ -986,7 +992,9 @@ func (n *ngt) LinearSearch(ctx context.Context, vec []float32, size uint32) (res
return n.toSearchResponse(sr)
}
-func (n *ngt) LinearSearchByID(ctx context.Context, uuid string, size uint32) (vec []float32, dst *payload.Search_Response, err error) {
+func (n *ngt) LinearSearchByID(
+ ctx context.Context, uuid string, size uint32,
+) (vec []float32, dst *payload.Search_Response, err error) {
if n.IsFlushing() {
return nil, nil, errors.ErrFlushingIsInProgress
}
@@ -1228,36 +1236,50 @@ func (n *ngt) RegenerateIndexes(ctx context.Context) (err error) {
if err != nil {
log.Errorf("failed to flushing vector to ngt index in delete kvs. error: %v", err)
}
- n.kvs = kvs.New(kvs.WithConcurrency(n.kvsdbConcurrency))
-
- n.vq, err = vqueue.New()
+ n.kvs = nil
+ n.vq = nil
// gc
runtime.GC()
atomic.AddUint64(&n.nogce, 1)
- // delete file
- err = file.DeleteDir(ctx, n.path)
- if err != nil {
- log.Errorf("failed to flushing vector to ngt index in delete file. error: %v", err)
- }
-
- // delete cow
- if n.enableCopyOnWrite {
- err := file.DeleteDir(ctx, n.oldPath)
+ if n.inMem {
+ // delete file
+ err = file.DeleteDir(ctx, n.path)
if err != nil {
- log.Errorf("failed to flushing vector to ngt index in delete file. error: %v", err)
+ log.Errorf("failed to flushing vector to ngt index in delete file.\tpath: '%s', error: %v", n.path, err)
+ }
+
+ // delete cow
+ if n.enableCopyOnWrite {
+ err := file.DeleteDir(ctx, n.oldPath)
+ if err != nil {
+ log.Errorf("failed to flushing vector to ngt index in delete file.\tpath: '%s', error: %v", n.oldPath, err)
+ }
}
}
+ nkvs := kvs.New(kvs.WithConcurrency(n.kvsdbConcurrency))
+
+ nvq, err := vqueue.New()
+ if err != nil {
+ log.Errorf("failed to create new vector vector queue. error: %v", err)
+ }
+
// renew instance
nn, err := newNGT(n.cfg, n.opts...)
if err != nil {
return err
}
+ nn.kvs = nkvs
+ nn.vq = nvq
+
// Regenerate with flags set
nn.flushing.Store(true)
nn.indexing.Store(true)
+ defer nn.flushing.Store(false)
+ defer nn.indexing.Store(false)
+
n = nn
return nil
@@ -1958,7 +1980,9 @@ func (n *ngt) ListObjectFunc(ctx context.Context, f func(uuid string, oid uint32
})
}
-func (n *ngt) toSearchResponse(sr []algorithm.SearchResult) (res *payload.Search_Response, err error) {
+func (n *ngt) toSearchResponse(
+ sr []algorithm.SearchResult,
+) (res *payload.Search_Response, err error) {
if len(sr) == 0 {
if n.Len() == 0 {
return nil, nil
diff --git a/pkg/agent/core/ngt/service/ngt_stateful_test.go b/pkg/agent/core/ngt/service/ngt_stateful_test.go
index 3280bcfb88..5880b836f4 100644
--- a/pkg/agent/core/ngt/service/ngt_stateful_test.go
+++ b/pkg/agent/core/ngt/service/ngt_stateful_test.go
@@ -1322,7 +1322,7 @@ func rootCommands(t *testing.T) commands.Commands {
GenCommandFunc: func(state commands.State) gopter.Gen {
st := state.(*ngtState)
- cs := make([]interface{}, 0)
+ cs := make([]any, 0)
cs = append(
cs,
existsACommand,
diff --git a/pkg/agent/core/ngt/service/ngt_test.go b/pkg/agent/core/ngt/service/ngt_test.go
index 3adcf18726..d8bf88a23d 100644
--- a/pkg/agent/core/ngt/service/ngt_test.go
+++ b/pkg/agent/core/ngt/service/ngt_test.go
@@ -38,6 +38,7 @@ import (
"github.com/vdaas/vald/internal/file"
kvald "github.com/vdaas/vald/internal/k8s/vald"
"github.com/vdaas/vald/internal/log"
+ "github.com/vdaas/vald/internal/net/grpc"
"github.com/vdaas/vald/internal/safety"
"github.com/vdaas/vald/internal/strings"
"github.com/vdaas/vald/internal/sync"
@@ -50,7 +51,6 @@ import (
"github.com/vdaas/vald/pkg/agent/internal/kvs"
"github.com/vdaas/vald/pkg/agent/internal/metadata"
"github.com/vdaas/vald/pkg/agent/internal/vqueue"
- "google.golang.org/grpc"
)
var defaultConfig = config.NGT{
@@ -1556,8 +1556,8 @@ func Test_ngt_E2E(t *testing.T) {
type args struct {
requests []*payload.Upsert_MultiRequest
- addr string
- dialOpts []grpc.DialOption
+ addr string
+ client grpc.Client
}
type want struct {
err error
@@ -1566,16 +1566,9 @@ func Test_ngt_E2E(t *testing.T) {
name string
args args
want want
- checkFunc func(want, error) error
beforeFunc func(args)
afterFunc func(args)
}
- defaultCheckFunc := func(w want, err error) error {
- if !errors.Is(err, w.err) {
- return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err)
- }
- return nil
- }
multiUpsertRequestGenFunc := func(idxes []index, chunk int) (res []*payload.Upsert_MultiRequest) {
reqs := make([]*payload.Upsert_Request, 0, chunk)
for i := 0; i < len(idxes); i++ {
@@ -1612,10 +1605,8 @@ func Test_ngt_E2E(t *testing.T) {
createRandomData(500000, new(createRandomDataConfig)),
50,
),
- addr: "127.0.0.1:8080",
- dialOpts: []grpc.DialOption{
- grpc.WithInsecure(),
- },
+ addr: "127.0.0.1:8080",
+ client: grpc.New(grpc.WithInsecure(true)),
},
},
}
@@ -1633,24 +1624,15 @@ func Test_ngt_E2E(t *testing.T) {
if test.afterFunc != nil {
defer test.afterFunc(test.args)
}
- checkFunc := test.checkFunc
- if test.checkFunc == nil {
- checkFunc = defaultCheckFunc
- }
- conn, err := grpc.DialContext(ctx, test.args.addr, test.args.dialOpts...)
- if err := checkFunc(test.want, err); err != nil {
- t.Fatal(err)
- }
- defer func() {
- if err := conn.Close(); err != nil {
- t.Error(err)
- }
- }()
- client := vald.NewValdClient(conn)
+
+ defer test.args.client.Close(ctx)
for i := 0; i < 2; i++ {
for _, req := range test.args.requests {
- _, err := client.MultiUpsert(ctx, req)
+ _, err := test.args.client.Do(ctx, test.args.addr,
+ func(ctx context.Context, conn *grpc.ClientConn, opts ...grpc.CallOption) (any, error) {
+ return vald.NewValdClient(conn).MultiUpsert(ctx, req)
+ })
if err != nil {
t.Error(err)
}
diff --git a/pkg/agent/internal/kvs/option.go b/pkg/agent/internal/kvs/option.go
index 06198c69dd..258f65b6f2 100644
--- a/pkg/agent/internal/kvs/option.go
+++ b/pkg/agent/internal/kvs/option.go
@@ -16,9 +16,7 @@
package kvs
-import (
- "runtime"
-)
+import "runtime"
// Option represents the functional option for bidi.
type Option func(n *bidi)
diff --git a/pkg/agent/internal/vqueue/queue.go b/pkg/agent/internal/vqueue/queue.go
index ce3fd8552f..ae073c5298 100644
--- a/pkg/agent/internal/vqueue/queue.go
+++ b/pkg/agent/internal/vqueue/queue.go
@@ -173,7 +173,9 @@ func (v *vqueue) DVExists(uuid string) bool {
return didx.date > idx.date
}
-func (v *vqueue) RangePopInsert(ctx context.Context, now int64, f func(uuid string, vector []float32, date int64) bool) {
+func (v *vqueue) RangePopInsert(
+ ctx context.Context, now int64, f func(uuid string, vector []float32, date int64) bool,
+) {
uii := make([]index, 0, atomic.LoadUint64(&v.ic))
defer func() {
uii = nil
diff --git a/pkg/agent/sidecar/handler/rest/handler.go b/pkg/agent/sidecar/handler/rest/handler.go
index 34a8dda12e..9a21b07b06 100644
--- a/pkg/agent/sidecar/handler/rest/handler.go
+++ b/pkg/agent/sidecar/handler/rest/handler.go
@@ -43,8 +43,8 @@ func New(opts ...Option) Handler {
}
func (*handler) Index(w http.ResponseWriter, r *http.Request) (int, error) {
- data := make(map[string]interface{})
- return json.Handler(w, r, &data, func() (interface{}, error) {
+ data := make(map[string]any)
+ return json.Handler(w, r, &data, func() (any, error) {
return dump.Request(nil, data, r)
})
}
diff --git a/pkg/agent/sidecar/handler/rest/option.go b/pkg/agent/sidecar/handler/rest/option.go
index ea7884a282..f183298e76 100644
--- a/pkg/agent/sidecar/handler/rest/option.go
+++ b/pkg/agent/sidecar/handler/rest/option.go
@@ -17,9 +17,7 @@
// Package rest provides rest api logic
package rest
-import (
- "github.com/vdaas/vald/apis/grpc/v1/agent/sidecar"
-)
+import "github.com/vdaas/vald/apis/grpc/v1/agent/sidecar"
type Option func(*handler)
diff --git a/pkg/agent/sidecar/router/option.go b/pkg/agent/sidecar/router/option.go
index 608300ea3e..91e9e8c523 100644
--- a/pkg/agent/sidecar/router/option.go
+++ b/pkg/agent/sidecar/router/option.go
@@ -17,9 +17,7 @@
// Package router provides implementation of Go API for routing http Handler wrapped by rest.Func
package router
-import (
- "github.com/vdaas/vald/pkg/agent/sidecar/handler/rest"
-)
+import "github.com/vdaas/vald/pkg/agent/sidecar/handler/rest"
type Option func(*router)
diff --git a/pkg/agent/sidecar/service/restorer/restorer.go b/pkg/agent/sidecar/service/restorer/restorer.go
index 91dff94d65..0d7312deef 100644
--- a/pkg/agent/sidecar/service/restorer/restorer.go
+++ b/pkg/agent/sidecar/service/restorer/restorer.go
@@ -127,7 +127,7 @@ func (r *restorer) startRestore(ctx context.Context) (<-chan error, error) {
return ech, err
}
- restore := func(ctx context.Context) (interface{}, bool, error) {
+ restore := func(ctx context.Context) (any, bool, error) {
err := r.restore(ctx)
if err != nil {
log.Errorf("restoring failed: %s", err)
diff --git a/pkg/discoverer/k8s/config/config.go b/pkg/discoverer/k8s/config/config.go
index fff4de8eaf..b29fbce0c4 100644
--- a/pkg/discoverer/k8s/config/config.go
+++ b/pkg/discoverer/k8s/config/config.go
@@ -17,9 +17,7 @@
// Package setting stores all server application settings
package config
-import (
- "github.com/vdaas/vald/internal/config"
-)
+import "github.com/vdaas/vald/internal/config"
type GlobalConfig = config.GlobalConfig
diff --git a/pkg/discoverer/k8s/handler/grpc/handler.go b/pkg/discoverer/k8s/handler/grpc/handler.go
index 588bd3f0e0..9a3fec538d 100644
--- a/pkg/discoverer/k8s/handler/grpc/handler.go
+++ b/pkg/discoverer/k8s/handler/grpc/handler.go
@@ -76,7 +76,9 @@ func New(opts ...Option) (ds DiscovererServer, err error) {
func (*server) Start(context.Context) {
}
-func (s *server) Pods(ctx context.Context, req *payload.Discoverer_Request) (*payload.Info_Pods, error) {
+func (s *server) Pods(
+ ctx context.Context, req *payload.Discoverer_Request,
+) (*payload.Info_Pods, error) {
ctx, span := trace.StartSpan(ctx, apiName+".Pods")
defer func() {
if span != nil {
@@ -148,7 +150,9 @@ func (s *server) Pods(ctx context.Context, req *payload.Discoverer_Request) (*pa
return cp, nil
}
-func (s *server) Nodes(ctx context.Context, req *payload.Discoverer_Request) (*payload.Info_Nodes, error) {
+func (s *server) Nodes(
+ ctx context.Context, req *payload.Discoverer_Request,
+) (*payload.Info_Nodes, error) {
ctx, span := trace.StartSpan(ctx, apiName+".Nodes")
defer func() {
if span != nil {
@@ -225,7 +229,9 @@ func (s *server) Nodes(ctx context.Context, req *payload.Discoverer_Request) (*p
}
// Services returns the services information that match the request.
-func (s *server) Services(ctx context.Context, req *payload.Discoverer_Request) (*payload.Info_Services, error) {
+func (s *server) Services(
+ ctx context.Context, req *payload.Discoverer_Request,
+) (*payload.Info_Services, error) {
ctx, span := trace.StartSpan(ctx, apiName+".Services")
defer func() {
if span != nil {
diff --git a/pkg/discoverer/k8s/handler/rest/handler.go b/pkg/discoverer/k8s/handler/rest/handler.go
index 188a057a66..576ae11f0b 100644
--- a/pkg/discoverer/k8s/handler/rest/handler.go
+++ b/pkg/discoverer/k8s/handler/rest/handler.go
@@ -46,22 +46,22 @@ func New(opts ...Option) Handler {
}
func (*handler) Index(w http.ResponseWriter, r *http.Request) (int, error) {
- data := make(map[string]interface{})
- return json.Handler(w, r, &data, func() (interface{}, error) {
+ data := make(map[string]any)
+ return json.Handler(w, r, &data, func() (any, error) {
return dump.Request(nil, data, r)
})
}
func (h *handler) Pods(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Discoverer_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.dsc.Pods(r.Context(), req)
})
}
func (h *handler) Nodes(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Discoverer_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.dsc.Nodes(r.Context(), req)
})
}
diff --git a/pkg/discoverer/k8s/service/discover.go b/pkg/discoverer/k8s/service/discover.go
index a551d920ce..c95b02420d 100644
--- a/pkg/discoverer/k8s/service/discover.go
+++ b/pkg/discoverer/k8s/service/discover.go
@@ -91,7 +91,7 @@ func New(selector *config.Selectors, opts ...Option) (dsc Discoverer, err error)
k8s.WithResourceController(mnode.New(
mnode.WithControllerName("node metrics discoverer"),
mnode.WithOnErrorFunc(func(err error) {
- log.Error("failed to reconcile:", err)
+ log.Error("failed to reconcile node metrics:", err)
}),
mnode.WithOnReconcileFunc(func(nodes map[string]mnode.Node) {
log.Debugf("node metrics reconciled\t%#v", nodes)
@@ -113,7 +113,7 @@ func New(selector *config.Selectors, opts ...Option) (dsc Discoverer, err error)
k8s.WithResourceController(mpod.New(
mpod.WithControllerName("pod metrics discoverer"),
mpod.WithOnErrorFunc(func(err error) {
- log.Error("failed to reconcile:", err)
+ log.Error("failed to reconcile pod metrics:", err)
}),
mpod.WithOnReconcileFunc(func(podList map[string]mpod.Pod) {
log.Debugf("pod metrics reconciled\t%#v", podList)
@@ -135,7 +135,7 @@ func New(selector *config.Selectors, opts ...Option) (dsc Discoverer, err error)
k8s.WithResourceController(pod.New(
pod.WithControllerName("pod discoverer"),
pod.WithOnErrorFunc(func(err error) {
- log.Error("failed to reconcile:", err)
+ log.Error("failed to reconcile pod resource:", err)
}),
pod.WithOnReconcileFunc(func(_ context.Context, podList map[string][]pod.Pod) {
log.Debugf("pod resource reconciled\t%#v", podList)
@@ -160,7 +160,7 @@ func New(selector *config.Selectors, opts ...Option) (dsc Discoverer, err error)
k8s.WithResourceController(node.New(
node.WithControllerName("node discoverer"),
node.WithOnErrorFunc(func(err error) {
- log.Error("failed to reconcile:", err)
+ log.Error("failed to reconcile node resource:", err)
}),
node.WithOnReconcileFunc(func(nodes []node.Node) {
log.Debugf("node resource reconciled\t%#v", nodes)
@@ -510,7 +510,9 @@ func (d *discoverer) GetPods(req *payload.Discoverer_Request) (pods *payload.Inf
return pods, nil
}
-func (d *discoverer) GetNodes(req *payload.Discoverer_Request) (nodes *payload.Info_Nodes, err error) {
+func (d *discoverer) GetNodes(
+ req *payload.Discoverer_Request,
+) (nodes *payload.Info_Nodes, err error) {
nodes = new(payload.Info_Nodes)
nbn, ok := d.nodeByName.Load().(map[string]*payload.Info_Node)
if !ok {
@@ -555,7 +557,9 @@ func (d *discoverer) GetNodes(req *payload.Discoverer_Request) (nodes *payload.I
}
// Get Services returns the services that matches the request.
-func (d *discoverer) GetServices(req *payload.Discoverer_Request) (svcs *payload.Info_Services, err error) {
+func (d *discoverer) GetServices(
+ req *payload.Discoverer_Request,
+) (svcs *payload.Info_Services, err error) {
svcs = new(payload.Info_Services)
sbn, ok := d.svcsByName.Load().(map[string]*payload.Info_Service)
if !ok {
diff --git a/pkg/gateway/filter/handler/grpc/handler.go b/pkg/gateway/filter/handler/grpc/handler.go
index aadf86077f..dd42febe0b 100644
--- a/pkg/gateway/filter/handler/grpc/handler.go
+++ b/pkg/gateway/filter/handler/grpc/handler.go
@@ -73,7 +73,9 @@ func New(opts ...Option) vald.ServerWithFilter {
return s
}
-func (s *server) SearchObject(ctx context.Context, req *payload.Search_ObjectRequest) (res *payload.Search_Response, err error) {
+func (s *server) SearchObject(
+ ctx context.Context, req *payload.Search_ObjectRequest,
+) (res *payload.Search_Response, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.SearchObjectRPCName), apiName+"/"+vald.SearchObjectRPCName)
defer func() {
if span != nil {
@@ -206,7 +208,9 @@ func (s *server) SearchObject(ctx context.Context, req *payload.Search_ObjectReq
})
}
-func (s *server) MultiSearchObject(ctx context.Context, reqs *payload.Search_MultiObjectRequest) (res *payload.Search_Responses, errs error) {
+func (s *server) MultiSearchObject(
+ ctx context.Context, reqs *payload.Search_MultiObjectRequest,
+) (res *payload.Search_Responses, errs error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.MultiSearchObjectRPCName), apiName+"/"+vald.MultiSearchObjectRPCName)
defer func() {
if span != nil {
@@ -324,7 +328,9 @@ func (s *server) StreamSearchObject(stream vald.Filter_StreamSearchObjectServer)
})
}
-func (s *server) LinearSearchObject(ctx context.Context, req *payload.Search_ObjectRequest) (*payload.Search_Response, error) {
+func (s *server) LinearSearchObject(
+ ctx context.Context, req *payload.Search_ObjectRequest,
+) (*payload.Search_Response, error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.LinearSearchObjectRPCName), apiName+"/"+vald.LinearSearchObjectRPCName)
defer func() {
if span != nil {
@@ -455,7 +461,9 @@ func (s *server) LinearSearchObject(ctx context.Context, req *payload.Search_Obj
})
}
-func (s *server) MultiLinearSearchObject(ctx context.Context, reqs *payload.Search_MultiObjectRequest) (res *payload.Search_Responses, errs error) {
+func (s *server) MultiLinearSearchObject(
+ ctx context.Context, reqs *payload.Search_MultiObjectRequest,
+) (res *payload.Search_Responses, errs error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.MultiLinearSearchObjectRPCName), apiName+"/"+vald.MultiLinearSearchObjectRPCName)
defer func() {
if span != nil {
@@ -580,7 +588,9 @@ func (s *server) StreamLinearSearchObject(stream vald.Filter_StreamSearchObjectS
return err
}
-func (s *server) InsertObject(ctx context.Context, req *payload.Insert_ObjectRequest) (*payload.Object_Location, error) {
+func (s *server) InsertObject(
+ ctx context.Context, req *payload.Insert_ObjectRequest,
+) (*payload.Object_Location, error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.InsertObjectRPCName), apiName+"/"+vald.InsertObjectRPCName)
defer func() {
if span != nil {
@@ -769,7 +779,9 @@ func (s *server) StreamInsertObject(stream vald.Filter_StreamInsertObjectServer)
return nil
}
-func (s *server) MultiInsertObject(ctx context.Context, reqs *payload.Insert_MultiObjectRequest) (locs *payload.Object_Locations, errs error) {
+func (s *server) MultiInsertObject(
+ ctx context.Context, reqs *payload.Insert_MultiObjectRequest,
+) (locs *payload.Object_Locations, errs error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.MultiInsertObjectRPCName), apiName+"/"+vald.MultiInsertObjectRPCName)
defer func() {
if span != nil {
@@ -833,7 +845,9 @@ func (s *server) MultiInsertObject(ctx context.Context, reqs *payload.Insert_Mul
return locs, errs
}
-func (s *server) UpdateObject(ctx context.Context, req *payload.Update_ObjectRequest) (*payload.Object_Location, error) {
+func (s *server) UpdateObject(
+ ctx context.Context, req *payload.Update_ObjectRequest,
+) (*payload.Object_Location, error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.UpdateObjectRPCName), apiName+"/"+vald.UpdateObjectRPCName)
defer func() {
if span != nil {
@@ -1022,7 +1036,9 @@ func (s *server) StreamUpdateObject(stream vald.Filter_StreamUpdateObjectServer)
return nil
}
-func (s *server) MultiUpdateObject(ctx context.Context, reqs *payload.Update_MultiObjectRequest) (locs *payload.Object_Locations, errs error) {
+func (s *server) MultiUpdateObject(
+ ctx context.Context, reqs *payload.Update_MultiObjectRequest,
+) (locs *payload.Object_Locations, errs error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.MultiUpdateObjectRPCName), apiName+"/"+vald.MultiUpdateObjectRPCName)
defer func() {
if span != nil {
@@ -1086,7 +1102,9 @@ func (s *server) MultiUpdateObject(ctx context.Context, reqs *payload.Update_Mul
return locs, errs
}
-func (s *server) UpsertObject(ctx context.Context, req *payload.Upsert_ObjectRequest) (*payload.Object_Location, error) {
+func (s *server) UpsertObject(
+ ctx context.Context, req *payload.Upsert_ObjectRequest,
+) (*payload.Object_Location, error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.UpsertObjectRPCName), apiName+"/"+vald.UpsertObjectRPCName)
defer func() {
if span != nil {
@@ -1283,7 +1301,9 @@ func (s *server) StreamUpsertObject(stream vald.Filter_StreamUpsertObjectServer)
return err
}
-func (s *server) MultiUpsertObject(ctx context.Context, reqs *payload.Upsert_MultiObjectRequest) (locs *payload.Object_Locations, errs error) {
+func (s *server) MultiUpsertObject(
+ ctx context.Context, reqs *payload.Upsert_MultiObjectRequest,
+) (locs *payload.Object_Locations, errs error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.MultiUpsertObjectRPCName), apiName+"/"+vald.MultiUpsertObjectRPCName)
defer func() {
if span != nil {
@@ -1356,7 +1376,9 @@ func (s *server) Exists(ctx context.Context, meta *payload.Object_ID) (*payload.
return s.gateway.Exists(ctx, meta, s.copts...)
}
-func (s *server) Search(ctx context.Context, req *payload.Search_Request) (res *payload.Search_Response, err error) {
+func (s *server) Search(
+ ctx context.Context, req *payload.Search_Request,
+) (res *payload.Search_Response, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.SearchRPCName), apiName+"/"+vald.SearchRPCName)
defer func() {
if span != nil {
@@ -1498,7 +1520,9 @@ func (s *server) Search(ctx context.Context, req *payload.Search_Request) (res *
return res, nil
}
-func (s *server) SearchByID(ctx context.Context, req *payload.Search_IDRequest) (res *payload.Search_Response, err error) {
+func (s *server) SearchByID(
+ ctx context.Context, req *payload.Search_IDRequest,
+) (res *payload.Search_Response, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.SearchByIDRPCName), apiName+"/"+vald.SearchByIDRPCName)
defer func() {
if span != nil {
@@ -1699,7 +1723,9 @@ func (s *server) StreamSearchByID(stream vald.Search_StreamSearchByIDServer) (er
return nil
}
-func (s *server) MultiSearch(ctx context.Context, reqs *payload.Search_MultiRequest) (res *payload.Search_Responses, errs error) {
+func (s *server) MultiSearch(
+ ctx context.Context, reqs *payload.Search_MultiRequest,
+) (res *payload.Search_Responses, errs error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.MultiSearchRPCName), apiName+"/"+vald.MultiSearchRPCName)
defer func() {
if span != nil {
@@ -1769,7 +1795,9 @@ func (s *server) MultiSearch(ctx context.Context, reqs *payload.Search_MultiRequ
return res, errs
}
-func (s *server) MultiSearchByID(ctx context.Context, reqs *payload.Search_MultiIDRequest) (res *payload.Search_Responses, errs error) {
+func (s *server) MultiSearchByID(
+ ctx context.Context, reqs *payload.Search_MultiIDRequest,
+) (res *payload.Search_Responses, errs error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.MultiSearchByIDRPCName), apiName+"/"+vald.MultiSearchByIDRPCName)
defer func() {
if span != nil {
@@ -1839,7 +1867,9 @@ func (s *server) MultiSearchByID(ctx context.Context, reqs *payload.Search_Multi
return res, errs
}
-func (s *server) LinearSearch(ctx context.Context, req *payload.Search_Request) (res *payload.Search_Response, err error) {
+func (s *server) LinearSearch(
+ ctx context.Context, req *payload.Search_Request,
+) (res *payload.Search_Response, err error) {
ctx, span := trace.StartSpan(ctx, apiName+"/"+vald.LinearSearchRPCName)
defer func() {
if span != nil {
@@ -1975,7 +2005,9 @@ func (s *server) LinearSearch(ctx context.Context, req *payload.Search_Request)
return res, nil
}
-func (s *server) LinearSearchByID(ctx context.Context, req *payload.Search_IDRequest) (res *payload.Search_Response, err error) {
+func (s *server) LinearSearchByID(
+ ctx context.Context, req *payload.Search_IDRequest,
+) (res *payload.Search_Response, err error) {
ctx, span := trace.StartSpan(ctx, apiName+"/"+vald.LinearSearchByIDRPCName)
defer func() {
if span != nil {
@@ -2114,7 +2146,9 @@ func (s *server) StreamLinearSearch(stream vald.Search_StreamLinearSearchServer)
return nil
}
-func (s *server) StreamLinearSearchByID(stream vald.Search_StreamLinearSearchByIDServer) (err error) {
+func (s *server) StreamLinearSearchByID(
+ stream vald.Search_StreamLinearSearchByIDServer,
+) (err error) {
ctx, span := trace.StartSpan(
grpc.WithGRPCMethod(stream.Context(), vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.StreamLinearSearchByIDRPCName),
apiName+"/"+vald.StreamLinearSearchByIDRPCName,
@@ -2175,7 +2209,9 @@ func (s *server) StreamLinearSearchByID(stream vald.Search_StreamLinearSearchByI
return nil
}
-func (s *server) MultiLinearSearch(ctx context.Context, reqs *payload.Search_MultiRequest) (res *payload.Search_Responses, errs error) {
+func (s *server) MultiLinearSearch(
+ ctx context.Context, reqs *payload.Search_MultiRequest,
+) (res *payload.Search_Responses, errs error) {
ctx, span := trace.StartSpan(ctx, apiName+"/"+vald.MultiLinearSearchRPCName)
defer func() {
if span != nil {
@@ -2237,7 +2273,9 @@ func (s *server) MultiLinearSearch(ctx context.Context, reqs *payload.Search_Mul
return res, errs
}
-func (s *server) MultiLinearSearchByID(ctx context.Context, reqs *payload.Search_MultiIDRequest) (res *payload.Search_Responses, errs error) {
+func (s *server) MultiLinearSearchByID(
+ ctx context.Context, reqs *payload.Search_MultiIDRequest,
+) (res *payload.Search_Responses, errs error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.MultiLinearSearchByIDRPCName), apiName+"/"+vald.MultiLinearSearchByIDRPCName)
defer func() {
if span != nil {
@@ -2299,7 +2337,9 @@ func (s *server) MultiLinearSearchByID(ctx context.Context, reqs *payload.Search
return res, errs
}
-func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc *payload.Object_Location, err error) {
+func (s *server) Insert(
+ ctx context.Context, req *payload.Insert_Request,
+) (loc *payload.Object_Location, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.InsertRPCName), apiName+"/"+vald.InsertRPCName)
defer func() {
if span != nil {
@@ -2504,7 +2544,9 @@ func (s *server) StreamInsert(stream vald.Insert_StreamInsertServer) (err error)
return nil
}
-func (s *server) MultiInsert(ctx context.Context, reqs *payload.Insert_MultiRequest) (locs *payload.Object_Locations, errs error) {
+func (s *server) MultiInsert(
+ ctx context.Context, reqs *payload.Insert_MultiRequest,
+) (locs *payload.Object_Locations, errs error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.MultiInsertRPCName), apiName+"/"+vald.MultiInsertRPCName)
defer func() {
if span != nil {
@@ -2574,7 +2616,9 @@ func (s *server) MultiInsert(ctx context.Context, reqs *payload.Insert_MultiRequ
return locs, errs
}
-func (s *server) Update(ctx context.Context, req *payload.Update_Request) (loc *payload.Object_Location, err error) {
+func (s *server) Update(
+ ctx context.Context, req *payload.Update_Request,
+) (loc *payload.Object_Location, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.UpdateRPCName), apiName+"/"+vald.UpdateRPCName)
defer func() {
if span != nil {
@@ -2758,7 +2802,9 @@ func (s *server) StreamUpdate(stream vald.Update_StreamUpdateServer) (err error)
return nil
}
-func (s *server) MultiUpdate(ctx context.Context, reqs *payload.Update_MultiRequest) (locs *payload.Object_Locations, errs error) {
+func (s *server) MultiUpdate(
+ ctx context.Context, reqs *payload.Update_MultiRequest,
+) (locs *payload.Object_Locations, errs error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.MultiUpdateRPCName), apiName+"/"+vald.MultiUpdateRPCName)
defer func() {
if span != nil {
@@ -2828,7 +2874,9 @@ func (s *server) MultiUpdate(ctx context.Context, reqs *payload.Update_MultiRequ
return locs, errs
}
-func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc *payload.Object_Location, err error) {
+func (s *server) Upsert(
+ ctx context.Context, req *payload.Upsert_Request,
+) (loc *payload.Object_Location, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.UpsertRPCName), apiName+"/"+vald.UpsertRPCName)
defer func() {
if span != nil {
@@ -3020,7 +3068,9 @@ func (s *server) StreamUpsert(stream vald.Upsert_StreamUpsertServer) (err error)
return nil
}
-func (s *server) MultiUpsert(ctx context.Context, reqs *payload.Upsert_MultiRequest) (locs *payload.Object_Locations, errs error) {
+func (s *server) MultiUpsert(
+ ctx context.Context, reqs *payload.Upsert_MultiRequest,
+) (locs *payload.Object_Locations, errs error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.MultiUpsertRPCName), apiName+"/"+vald.MultiUpsertRPCName)
defer func() {
if span != nil {
@@ -3083,7 +3133,9 @@ func (s *server) MultiUpsert(ctx context.Context, reqs *payload.Upsert_MultiRequ
return locs, errs
}
-func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (loc *payload.Object_Location, err error) {
+func (s *server) Remove(
+ ctx context.Context, req *payload.Remove_Request,
+) (loc *payload.Object_Location, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.RemoveRPCName), apiName+"/"+vald.RemoveRPCName)
defer func() {
if span != nil {
@@ -3183,7 +3235,9 @@ func (s *server) StreamRemove(stream vald.Remove_StreamRemoveServer) (err error)
return nil
}
-func (s *server) MultiRemove(ctx context.Context, reqs *payload.Remove_MultiRequest) (locs *payload.Object_Locations, errs error) {
+func (s *server) MultiRemove(
+ ctx context.Context, reqs *payload.Remove_MultiRequest,
+) (locs *payload.Object_Locations, errs error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.MultiRemoveRPCName), apiName+"/"+vald.MultiRemoveRPCName)
defer func() {
if span != nil {
@@ -3246,7 +3300,9 @@ func (s *server) MultiRemove(ctx context.Context, reqs *payload.Remove_MultiRequ
return locs, errs
}
-func (s *server) Flush(ctx context.Context, req *payload.Flush_Request) (loc *payload.Info_Index_Count, err error) {
+func (s *server) Flush(
+ ctx context.Context, req *payload.Flush_Request,
+) (loc *payload.Info_Index_Count, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.FlushRPCName), apiName+"/"+vald.FlushRPCName)
defer func() {
if span != nil {
@@ -3256,7 +3312,9 @@ func (s *server) Flush(ctx context.Context, req *payload.Flush_Request) (loc *pa
return s.gateway.Flush(ctx, req, s.copts...)
}
-func (s *server) RemoveByTimestamp(ctx context.Context, req *payload.Remove_TimestampRequest) (*payload.Object_Locations, error) {
+func (s *server) RemoveByTimestamp(
+ ctx context.Context, req *payload.Remove_TimestampRequest,
+) (*payload.Object_Locations, error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.RemoveByTimestampRPCName), apiName+"/"+vald.RemoveByTimestampRPCName)
defer func() {
if span != nil {
@@ -3299,7 +3357,9 @@ func (s *server) RemoveByTimestamp(ctx context.Context, req *payload.Remove_Time
return locs, nil
}
-func (s *server) GetObject(ctx context.Context, req *payload.Object_VectorRequest) (vec *payload.Object_Vector, err error) {
+func (s *server) GetObject(
+ ctx context.Context, req *payload.Object_VectorRequest,
+) (vec *payload.Object_Vector, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.GetObjectRPCName), apiName+"/"+vald.GetObjectRPCName)
defer func() {
if span != nil {
diff --git a/pkg/gateway/filter/handler/rest/handler.go b/pkg/gateway/filter/handler/rest/handler.go
index bb2a7b24a7..f8d4c363c6 100644
--- a/pkg/gateway/filter/handler/rest/handler.go
+++ b/pkg/gateway/filter/handler/rest/handler.go
@@ -71,197 +71,199 @@ func New(opts ...Option) Handler {
}
func (*handler) Index(w http.ResponseWriter, r *http.Request) (int, error) {
- data := make(map[string]interface{})
- return json.Handler(w, r, &data, func() (interface{}, error) {
+ data := make(map[string]any)
+ return json.Handler(w, r, &data, func() (any, error) {
return dump.Request(nil, data, r)
})
}
func (h *handler) Search(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.Search(r.Context(), req)
})
}
func (h *handler) SearchByID(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_IDRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.SearchByID(r.Context(), req)
})
}
func (h *handler) MultiSearch(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_MultiRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.MultiSearch(r.Context(), req)
})
}
func (h *handler) MultiSearchByID(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_MultiIDRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.MultiSearchByID(r.Context(), req)
})
}
func (h *handler) LinearSearch(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.LinearSearch(r.Context(), req)
})
}
func (h *handler) LinearSearchByID(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_IDRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.LinearSearchByID(r.Context(), req)
})
}
func (h *handler) MultiLinearSearch(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_MultiRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.MultiLinearSearch(r.Context(), req)
})
}
-func (h *handler) MultiLinearSearchByID(w http.ResponseWriter, r *http.Request) (code int, err error) {
+func (h *handler) MultiLinearSearchByID(
+ w http.ResponseWriter, r *http.Request,
+) (code int, err error) {
var req *payload.Search_MultiIDRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.MultiLinearSearchByID(r.Context(), req)
})
}
func (h *handler) Insert(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Insert_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.Insert(r.Context(), req)
})
}
func (h *handler) MultiInsert(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Insert_MultiRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.MultiInsert(r.Context(), req)
})
}
func (h *handler) Update(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Update_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.Update(r.Context(), req)
})
}
func (h *handler) MultiUpdate(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Update_MultiRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.MultiUpdate(r.Context(), req)
})
}
func (h *handler) Upsert(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Upsert_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.Upsert(r.Context(), req)
})
}
func (h *handler) MultiUpsert(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Upsert_MultiRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.MultiUpsert(r.Context(), req)
})
}
func (h *handler) Remove(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Remove_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.Remove(r.Context(), req)
})
}
func (h *handler) MultiRemove(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Remove_MultiRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.MultiRemove(r.Context(), req)
})
}
func (h *handler) Flush(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Flush_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.Flush(r.Context(), req)
})
}
func (h *handler) GetObject(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Object_VectorRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.GetObject(r.Context(), req)
})
}
func (h *handler) Exists(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Object_ID
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.Exists(r.Context(), req)
})
}
func (h *handler) SearchObject(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_ObjectRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.SearchObject(r.Context(), req)
})
}
func (h *handler) InsertObject(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Insert_ObjectRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.InsertObject(r.Context(), req)
})
}
func (h *handler) UpdateObject(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Update_ObjectRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.UpdateObject(r.Context(), req)
})
}
func (h *handler) UpsertObject(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Upsert_ObjectRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.UpsertObject(r.Context(), req)
})
}
func (h *handler) MultiSearchObject(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_MultiObjectRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.MultiSearchObject(r.Context(), req)
})
}
func (h *handler) MultiInsertObject(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Insert_MultiObjectRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.MultiInsertObject(r.Context(), req)
})
}
func (h *handler) MultiUpdateObject(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Update_MultiObjectRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.MultiUpdateObject(r.Context(), req)
})
}
func (h *handler) MultiUpsertObject(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Upsert_MultiObjectRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.MultiUpsertObject(r.Context(), req)
})
}
diff --git a/pkg/gateway/filter/router/option.go b/pkg/gateway/filter/router/option.go
index 15d81aeed2..a45c264466 100644
--- a/pkg/gateway/filter/router/option.go
+++ b/pkg/gateway/filter/router/option.go
@@ -17,9 +17,7 @@
// Package router provides implementation of Go API for routing http Handler wrapped by rest.Func
package router
-import (
- "github.com/vdaas/vald/pkg/gateway/filter/handler/rest"
-)
+import "github.com/vdaas/vald/pkg/gateway/filter/handler/rest"
type Option func(*router)
diff --git a/pkg/gateway/lb/handler/grpc/aggregation.go b/pkg/gateway/lb/handler/grpc/aggregation.go
index 21eededf57..596762cabc 100644
--- a/pkg/gateway/lb/handler/grpc/aggregation.go
+++ b/pkg/gateway/lb/handler/grpc/aggregation.go
@@ -49,13 +49,14 @@ type DistPayload struct {
distance *big.Float
}
-func (s *server) aggregationSearch(ctx context.Context, aggr Aggregator,
+func (s *server) aggregationSearch(
+ ctx context.Context,
+ aggr Aggregator,
bcfg *payload.Search_Config, // Base Config of Request
f func(ctx context.Context,
fcfg *payload.Search_Config, // Forwarding Config to Agent
- vc vald.Client, copts ...grpc.CallOption) (*payload.Search_Response, error)) (
- res *payload.Search_Response, err error,
-) {
+ vc vald.Client, copts ...grpc.CallOption) (*payload.Search_Response, error),
+) (res *payload.Search_Response, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "aggregationSearch"), apiName+"/aggregationSearch")
defer func() {
if span != nil {
@@ -665,7 +666,7 @@ type valdPoolSliceAggr struct {
var (
poolDist = sync.Pool{
- New: func() interface{} {
+ New: func() any {
return make([]*DistPayload, 0, poolLen.Load())
},
}
diff --git a/pkg/gateway/lb/handler/grpc/handler.go b/pkg/gateway/lb/handler/grpc/handler.go
index b79ac366af..a25d06078e 100644
--- a/pkg/gateway/lb/handler/grpc/handler.go
+++ b/pkg/gateway/lb/handler/grpc/handler.go
@@ -206,7 +206,9 @@ func (s *server) exists(ctx context.Context, uuid string) (id *payload.Object_ID
return id, nil
}
-func (s *server) Exists(ctx context.Context, meta *payload.Object_ID) (id *payload.Object_ID, err error) {
+func (s *server) Exists(
+ ctx context.Context, meta *payload.Object_ID,
+) (id *payload.Object_ID, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.ObjectRPCServiceName+"/"+vald.ExistsRPCName), apiName+"/"+vald.ExistsRPCName)
defer func() {
if span != nil {
@@ -267,7 +269,9 @@ func (s *server) Exists(ctx context.Context, meta *payload.Object_ID) (id *paylo
return nil, err
}
-func (s *server) Search(ctx context.Context, req *payload.Search_Request) (res *payload.Search_Response, err error) {
+func (s *server) Search(
+ ctx context.Context, req *payload.Search_Request,
+) (res *payload.Search_Response, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.SearchRPCName), apiName+"/"+vald.SearchRPCName)
defer func() {
if span != nil {
@@ -321,9 +325,9 @@ func (s *server) Search(ctx context.Context, req *payload.Search_Request) (res *
return res, nil
}
-func (s *server) SearchByID(ctx context.Context, req *payload.Search_IDRequest) (
- res *payload.Search_Response, err error,
-) {
+func (s *server) SearchByID(
+ ctx context.Context, req *payload.Search_IDRequest,
+) (res *payload.Search_Response, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.SearchByIDRPCName), apiName+"/"+vald.SearchByIDRPCName)
defer func() {
if span != nil {
@@ -463,10 +467,11 @@ func (s *server) calculateNum(ctx context.Context, num uint32, ratio float32) (n
return n - 1
}
-func (s *server) doSearch(ctx context.Context, cfg *payload.Search_Config,
- f func(ctx context.Context, cfg *payload.Search_Config, vc vald.Client, copts ...grpc.CallOption) (*payload.Search_Response, error)) (
- res *payload.Search_Response, err error,
-) {
+func (s *server) doSearch(
+ ctx context.Context,
+ cfg *payload.Search_Config,
+ f func(ctx context.Context, cfg *payload.Search_Config, vc vald.Client, copts ...grpc.CallOption) (*payload.Search_Response, error),
+) (res *payload.Search_Response, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "doSearch"), apiName+"/doSearch")
defer func() {
if span != nil {
@@ -601,7 +606,9 @@ func (s *server) StreamSearchByID(stream vald.Search_StreamSearchByIDServer) (er
return nil
}
-func (s *server) MultiSearch(ctx context.Context, reqs *payload.Search_MultiRequest) (res *payload.Search_Responses, errs error) {
+func (s *server) MultiSearch(
+ ctx context.Context, reqs *payload.Search_MultiRequest,
+) (res *payload.Search_Responses, errs error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.MultiSearchRPCName), apiName+"/"+vald.MultiSearchRPCName)
defer func() {
if span != nil {
@@ -675,7 +682,9 @@ func (s *server) MultiSearch(ctx context.Context, reqs *payload.Search_MultiRequ
return res, nil
}
-func (s *server) MultiSearchByID(ctx context.Context, reqs *payload.Search_MultiIDRequest) (res *payload.Search_Responses, errs error) {
+func (s *server) MultiSearchByID(
+ ctx context.Context, reqs *payload.Search_MultiIDRequest,
+) (res *payload.Search_Responses, errs error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.MultiSearchByIDRPCName), apiName+"/"+vald.MultiSearchByIDRPCName)
defer func() {
if span != nil {
@@ -750,7 +759,9 @@ func (s *server) MultiSearchByID(ctx context.Context, reqs *payload.Search_Multi
return res, nil
}
-func (s *server) LinearSearch(ctx context.Context, req *payload.Search_Request) (res *payload.Search_Response, err error) {
+func (s *server) LinearSearch(
+ ctx context.Context, req *payload.Search_Request,
+) (res *payload.Search_Response, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.LinearSearchRPCName), apiName+"/"+vald.LinearSearchRPCName)
defer func() {
if span != nil {
@@ -804,9 +815,9 @@ func (s *server) LinearSearch(ctx context.Context, req *payload.Search_Request)
return res, nil
}
-func (s *server) LinearSearchByID(ctx context.Context, req *payload.Search_IDRequest) (
- res *payload.Search_Response, err error,
-) {
+func (s *server) LinearSearchByID(
+ ctx context.Context, req *payload.Search_IDRequest,
+) (res *payload.Search_Response, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.LinearSearchByIDRPCName), apiName+"/"+vald.LinearSearchByIDRPCName)
defer func() {
if span != nil {
@@ -979,7 +990,9 @@ func (s *server) StreamLinearSearch(stream vald.Search_StreamLinearSearchServer)
return nil
}
-func (s *server) StreamLinearSearchByID(stream vald.Search_StreamLinearSearchByIDServer) (err error) {
+func (s *server) StreamLinearSearchByID(
+ stream vald.Search_StreamLinearSearchByIDServer,
+) (err error) {
ctx, span := trace.StartSpan(
grpc.WithGRPCMethod(stream.Context(), vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.StreamLinearSearchByIDRPCName),
apiName+"/"+vald.StreamLinearSearchByIDRPCName,
@@ -1030,7 +1043,9 @@ func (s *server) StreamLinearSearchByID(stream vald.Search_StreamLinearSearchByI
return nil
}
-func (s *server) MultiLinearSearch(ctx context.Context, reqs *payload.Search_MultiRequest) (res *payload.Search_Responses, errs error) {
+func (s *server) MultiLinearSearch(
+ ctx context.Context, reqs *payload.Search_MultiRequest,
+) (res *payload.Search_Responses, errs error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.MultiLinearSearchRPCName), apiName+"/"+vald.MultiLinearSearchRPCName)
defer func() {
if span != nil {
@@ -1104,7 +1119,9 @@ func (s *server) MultiLinearSearch(ctx context.Context, reqs *payload.Search_Mul
return res, nil
}
-func (s *server) MultiLinearSearchByID(ctx context.Context, reqs *payload.Search_MultiIDRequest) (res *payload.Search_Responses, errs error) {
+func (s *server) MultiLinearSearchByID(
+ ctx context.Context, reqs *payload.Search_MultiIDRequest,
+) (res *payload.Search_Responses, errs error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.MultiLinearSearchByIDRPCName), apiName+"/"+vald.MultiLinearSearchByIDRPCName)
defer func() {
if span != nil {
@@ -1179,7 +1196,9 @@ func (s *server) MultiLinearSearchByID(ctx context.Context, reqs *payload.Search
return res, nil
}
-func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (ce *payload.Object_Location, err error) {
+func (s *server) Insert(
+ ctx context.Context, req *payload.Insert_Request,
+) (ce *payload.Object_Location, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.InsertRPCServiceName+"/"+vald.InsertRPCName), apiName+"/"+vald.InsertRPCName)
defer func() {
if span != nil {
@@ -1447,7 +1466,9 @@ func (s *server) StreamInsert(stream vald.Insert_StreamInsertServer) (err error)
return nil
}
-func (s *server) MultiInsert(ctx context.Context, reqs *payload.Insert_MultiRequest) (locs *payload.Object_Locations, errs error) {
+func (s *server) MultiInsert(
+ ctx context.Context, reqs *payload.Insert_MultiRequest,
+) (locs *payload.Object_Locations, errs error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.InsertRPCServiceName+"/"+vald.MultiInsertRPCName), apiName+"/"+vald.MultiInsertRPCName)
defer func() {
if span != nil {
@@ -1560,7 +1581,9 @@ func (s *server) MultiInsert(ctx context.Context, reqs *payload.Insert_MultiRequ
return locs, errs
}
-func (s *server) Update(ctx context.Context, req *payload.Update_Request) (res *payload.Object_Location, err error) {
+func (s *server) Update(
+ ctx context.Context, req *payload.Update_Request,
+) (res *payload.Object_Location, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.UpdateRPCServiceName+"/"+vald.UpdateRPCName), apiName+"/"+vald.UpdateRPCName)
defer func() {
if span != nil {
@@ -1983,7 +2006,9 @@ func (s *server) StreamUpdate(stream vald.Update_StreamUpdateServer) (err error)
return nil
}
-func (s *server) MultiUpdate(ctx context.Context, reqs *payload.Update_MultiRequest) (locs *payload.Object_Locations, errs error) {
+func (s *server) MultiUpdate(
+ ctx context.Context, reqs *payload.Update_MultiRequest,
+) (locs *payload.Object_Locations, errs error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.UpdateRPCServiceName+"/"+vald.MultiUpdateRPCName), apiName+"/"+vald.MultiUpdateRPCName)
defer func() {
if span != nil {
@@ -2096,7 +2121,9 @@ func (s *server) MultiUpdate(ctx context.Context, reqs *payload.Update_MultiRequ
return locs, errs
}
-func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc *payload.Object_Location, err error) {
+func (s *server) Upsert(
+ ctx context.Context, req *payload.Upsert_Request,
+) (loc *payload.Object_Location, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.UpsertRPCServiceName+"/"+vald.UpsertRPCName), apiName+"/"+vald.UpsertRPCName)
defer func() {
if span != nil {
@@ -2331,7 +2358,9 @@ func (s *server) StreamUpsert(stream vald.Upsert_StreamUpsertServer) (err error)
return nil
}
-func (s *server) MultiUpsert(ctx context.Context, reqs *payload.Upsert_MultiRequest) (locs *payload.Object_Locations, errs error) {
+func (s *server) MultiUpsert(
+ ctx context.Context, reqs *payload.Upsert_MultiRequest,
+) (locs *payload.Object_Locations, errs error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.UpsertRPCServiceName+"/"+vald.MultiUpsertRPCName), apiName+"/"+vald.MultiUpsertRPCName)
defer func() {
if span != nil {
@@ -2444,7 +2473,9 @@ func (s *server) MultiUpsert(ctx context.Context, reqs *payload.Upsert_MultiRequ
return locs, errs
}
-func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (locs *payload.Object_Location, err error) {
+func (s *server) Remove(
+ ctx context.Context, req *payload.Remove_Request,
+) (locs *payload.Object_Location, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.RemoveRPCServiceName+"/"+vald.RemoveRPCName), apiName+"/"+vald.RemoveRPCName)
defer func() {
if span != nil {
@@ -2634,7 +2665,9 @@ func (s *server) StreamRemove(stream vald.Remove_StreamRemoveServer) (err error)
return nil
}
-func (s *server) MultiRemove(ctx context.Context, reqs *payload.Remove_MultiRequest) (locs *payload.Object_Locations, errs error) {
+func (s *server) MultiRemove(
+ ctx context.Context, reqs *payload.Remove_MultiRequest,
+) (locs *payload.Object_Locations, errs error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.RemoveRPCServiceName+"/"+vald.MultiRemoveRPCName), apiName+"/"+vald.MultiRemoveRPCName)
defer func() {
if span != nil {
@@ -2736,7 +2769,9 @@ func (s *server) MultiRemove(ctx context.Context, reqs *payload.Remove_MultiRequ
return locs, errs
}
-func (s *server) RemoveByTimestamp(ctx context.Context, req *payload.Remove_TimestampRequest) (locs *payload.Object_Locations, errs error) {
+func (s *server) RemoveByTimestamp(
+ ctx context.Context, req *payload.Remove_TimestampRequest,
+) (locs *payload.Object_Locations, errs error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.RemoveRPCServiceName+"/"+vald.RemoveByTimestampRPCName), apiName+"/"+vald.RemoveByTimestampRPCName)
defer func() {
if span != nil {
@@ -2861,7 +2896,9 @@ func (s *server) RemoveByTimestamp(ctx context.Context, req *payload.Remove_Time
return locs, nil
}
-func (s *server) getObject(ctx context.Context, uuid string) (vec *payload.Object_Vector, err error) {
+func (s *server) getObject(
+ ctx context.Context, uuid string,
+) (vec *payload.Object_Vector, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "getObject"), apiName+"/"+vald.GetObjectRPCName+"/getObject")
defer func() {
if span != nil {
@@ -2989,7 +3026,9 @@ func (s *server) getObject(ctx context.Context, uuid string) (vec *payload.Objec
return vec, nil
}
-func (s *server) Flush(ctx context.Context, req *payload.Flush_Request) (cnts *payload.Info_Index_Count, err error) {
+func (s *server) Flush(
+ ctx context.Context, req *payload.Flush_Request,
+) (cnts *payload.Info_Index_Count, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FlushRPCServiceName+"/"+vald.FlushRPCName), apiName+"/"+vald.FlushRPCName)
defer func() {
if span != nil {
@@ -3072,7 +3111,7 @@ func (s *server) Flush(ctx context.Context, req *payload.Flush_Request) (cnts *p
}
if cnts.Stored > 0 || cnts.Uncommitted > 0 || cnts.Indexing || cnts.Saving {
err = errors.Errorf(
- "stored index: %d, uncommited: %d, indexing: %t, saving: %t",
+ "stored index: %d, uncommitted: %d, indexing: %t, saving: %t",
cnts.Stored, cnts.Uncommitted, cnts.Indexing, cnts.Saving,
)
err = status.WrapWithInternal(vald.FlushRPCName+" API flush failed", err,
@@ -3095,7 +3134,9 @@ func (s *server) Flush(ctx context.Context, req *payload.Flush_Request) (cnts *p
return cnts, nil
}
-func (s *server) GetObject(ctx context.Context, req *payload.Object_VectorRequest) (vec *payload.Object_Vector, err error) {
+func (s *server) GetObject(
+ ctx context.Context, req *payload.Object_VectorRequest,
+) (vec *payload.Object_Vector, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.ObjectRPCServiceName+"/"+vald.GetObjectRPCName), apiName+"/"+vald.GetObjectRPCName)
defer func() {
if span != nil {
@@ -3207,7 +3248,9 @@ func (s *server) StreamGetObject(stream vald.Object_StreamGetObjectServer) (err
return nil
}
-func (s *server) StreamListObject(req *payload.Object_List_Request, stream vald.Object_StreamListObjectServer) error {
+func (s *server) StreamListObject(
+ req *payload.Object_List_Request, stream vald.Object_StreamListObjectServer,
+) error {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(stream.Context(), vald.PackageName+"."+vald.ObjectRPCServiceName+"/"+vald.StreamListObjectRPCName), apiName+"/"+vald.StreamListObjectRPCName)
defer func() {
if span != nil {
@@ -3293,3 +3336,432 @@ func (s *server) StreamListObject(req *payload.Object_List_Request, stream vald.
})
return err
}
+
+func (s *server) IndexInfo(
+ ctx context.Context, _ *payload.Empty,
+) (vec *payload.Info_Index_Count, err error) {
+ ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.IndexRPCServiceName+"/"+vald.IndexInfoRPCName), apiName+"/"+vald.IndexInfoRPCName)
+ defer func() {
+ if span != nil {
+ span.End()
+ }
+ }()
+ ech := make(chan error, 1)
+ var (
+ stored, uncommitted atomic.Uint32
+ indexing, saving atomic.Bool
+ )
+ s.eg.Go(safety.RecoverFunc(func() error {
+ defer close(ech)
+ ech <- s.gateway.BroadCast(ctx, service.READ, func(ctx context.Context, target string, vc vald.Client, copts ...grpc.CallOption) error {
+ sctx, sspan := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "BroadCast/"+target), apiName+"/"+vald.IndexInfoRPCName+"/"+target)
+ defer func() {
+ if sspan != nil {
+ sspan.End()
+ }
+ }()
+ info, err := vc.IndexInfo(sctx, new(payload.Empty), copts...)
+ if err != nil {
+ var (
+ attrs trace.Attributes
+ st *status.Status
+ msg string
+ code codes.Code
+ )
+ switch {
+ case errors.Is(err, context.Canceled),
+ errors.Is(err, errors.ErrRPCCallFailed(target, context.Canceled)):
+ attrs = trace.StatusCodeCancelled(
+ errdetails.ValdGRPCResourceTypePrefix +
+ "/vald.v1." + vald.IndexInfoRPCName + ".BroadCast/" +
+ target + " canceled: " + err.Error())
+ code = codes.Canceled
+ case errors.Is(err, context.DeadlineExceeded),
+ errors.Is(err, errors.ErrRPCCallFailed(target, context.DeadlineExceeded)):
+ attrs = trace.StatusCodeDeadlineExceeded(
+ errdetails.ValdGRPCResourceTypePrefix +
+ "/vald.v1." + vald.IndexInfoRPCName + ".BroadCast/" +
+ target + " deadline_exceeded: " + err.Error())
+ code = codes.DeadlineExceeded
+ default:
+ st, msg, err = status.ParseError(err, codes.NotFound, "error "+vald.IndexInfoRPCName+" API",
+ &errdetails.ResourceInfo{
+ ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.IndexInfoRPCName + ".BroadCase/" + target,
+ ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target),
+ })
+ if st != nil {
+ code = st.Code()
+ } else {
+ code = codes.NotFound
+ }
+ attrs = trace.FromGRPCStatus(code, msg)
+ }
+ if sspan != nil {
+ sspan.RecordError(err)
+ sspan.SetAttributes(attrs...)
+ sspan.SetStatus(trace.StatusError, err.Error())
+ }
+ if err != nil && st != nil &&
+ code != codes.Canceled &&
+ code != codes.DeadlineExceeded &&
+ code != codes.InvalidArgument &&
+ code != codes.NotFound &&
+ code != codes.OK &&
+ code != codes.Unimplemented {
+ return err
+ }
+ return nil
+ }
+ if info != nil {
+ stored.Add(info.GetStored())
+ uncommitted.Add(info.GetUncommitted())
+ if info.GetIndexing() {
+ indexing.Store(true)
+ }
+ if info.GetSaving() {
+ saving.Store(true)
+ }
+ }
+ return nil
+ })
+ return nil
+ }))
+ select {
+ case <-ctx.Done():
+ err = ctx.Err()
+ case err = <-ech:
+ }
+ if err != nil {
+ resInfo := &errdetails.ResourceInfo{
+ ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.IndexInfoRPCName,
+ ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)),
+ }
+ var attrs trace.Attributes
+ switch {
+ case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")):
+ err = status.WrapWithInternal(vald.IndexInfoRPCName+" API connection not found", err, resInfo)
+ attrs = trace.StatusCodeInternal(err.Error())
+ case errors.Is(err, context.Canceled):
+ err = status.WrapWithCanceled(vald.IndexInfoRPCName+" API canceled", err, resInfo)
+ attrs = trace.StatusCodeCancelled(err.Error())
+ case errors.Is(err, context.DeadlineExceeded):
+ err = status.WrapWithDeadlineExceeded(vald.IndexInfoRPCName+" API deadline exceeded", err, resInfo)
+ attrs = trace.StatusCodeDeadlineExceeded(err.Error())
+ default:
+ var (
+ st *status.Status
+ msg string
+ )
+ st, msg, err = status.ParseError(err, codes.Unknown, vald.IndexInfoRPCName+" API request returned error", resInfo)
+ attrs = trace.FromGRPCStatus(st.Code(), msg)
+ }
+ log.Debug(err)
+ if span != nil {
+ span.RecordError(err)
+ span.SetAttributes(attrs...)
+ span.SetStatus(trace.StatusError, err.Error())
+ }
+ return nil, err
+ }
+ return &payload.Info_Index_Count{
+ Stored: stored.Load(),
+ Uncommitted: uncommitted.Load(),
+ Indexing: indexing.Load(),
+ Saving: saving.Load(),
+ }, nil
+}
+
+func (s *server) IndexDetail(
+ ctx context.Context, _ *payload.Empty,
+) (vec *payload.Info_Index_Detail, err error) {
+ ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.IndexRPCServiceName+"/"+vald.IndexDetailRPCName), apiName+"/"+vald.IndexDetailRPCName)
+ defer func() {
+ if span != nil {
+ span.End()
+ }
+ }()
+ ech := make(chan error, 1)
+ var (
+ mu sync.Mutex
+ detail = &payload.Info_Index_Detail{
+ Counts: make(map[string]*payload.Info_Index_Count),
+ Replica: uint32(s.replica),
+ LiveAgents: uint32(s.gateway.GetAgentCount(ctx)),
+ }
+ )
+ s.eg.Go(safety.RecoverFunc(func() error {
+ defer close(ech)
+ ech <- s.gateway.BroadCast(ctx, service.READ, func(ctx context.Context, target string, vc vald.Client, copts ...grpc.CallOption) error {
+ sctx, sspan := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "BroadCast/"+target), apiName+"/"+vald.IndexDetailRPCName+"/"+target)
+ defer func() {
+ if sspan != nil {
+ sspan.End()
+ }
+ }()
+ info, err := vc.IndexInfo(sctx, new(payload.Empty), copts...)
+ if err != nil {
+ var (
+ attrs trace.Attributes
+ st *status.Status
+ msg string
+ code codes.Code
+ )
+ switch {
+ case errors.Is(err, context.Canceled),
+ errors.Is(err, errors.ErrRPCCallFailed(target, context.Canceled)):
+ attrs = trace.StatusCodeCancelled(
+ errdetails.ValdGRPCResourceTypePrefix +
+ "/vald.v1." + vald.IndexDetailRPCName + ".BroadCast/" +
+ target + " canceled: " + err.Error())
+ code = codes.Canceled
+ case errors.Is(err, context.DeadlineExceeded),
+ errors.Is(err, errors.ErrRPCCallFailed(target, context.DeadlineExceeded)):
+ attrs = trace.StatusCodeDeadlineExceeded(
+ errdetails.ValdGRPCResourceTypePrefix +
+ "/vald.v1." + vald.IndexDetailRPCName + ".BroadCast/" +
+ target + " deadline_exceeded: " + err.Error())
+ code = codes.DeadlineExceeded
+ default:
+ st, msg, err = status.ParseError(err, codes.NotFound, "error "+vald.IndexDetailRPCName+" API",
+ &errdetails.ResourceInfo{
+ ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.IndexDetailRPCName + ".BroadCase/" + target,
+ ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target),
+ })
+ if st != nil {
+ code = st.Code()
+ } else {
+ code = codes.NotFound
+ }
+ attrs = trace.FromGRPCStatus(code, msg)
+ }
+ if sspan != nil {
+ sspan.RecordError(err)
+ sspan.SetAttributes(attrs...)
+ sspan.SetStatus(trace.StatusError, err.Error())
+ }
+ if err != nil && st != nil &&
+ code != codes.Canceled &&
+ code != codes.DeadlineExceeded &&
+ code != codes.InvalidArgument &&
+ code != codes.NotFound &&
+ code != codes.OK &&
+ code != codes.Unimplemented {
+ return err
+ }
+ return nil
+ }
+ if info != nil {
+ mu.Lock()
+ detail.Counts[target] = info
+ mu.Unlock()
+ }
+ return nil
+ })
+ return nil
+ }))
+ select {
+ case <-ctx.Done():
+ err = ctx.Err()
+ case err = <-ech:
+ }
+ if err != nil {
+ resInfo := &errdetails.ResourceInfo{
+ ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.IndexDetailRPCName,
+ ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)),
+ }
+ var attrs trace.Attributes
+ switch {
+ case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")):
+ err = status.WrapWithInternal(vald.IndexDetailRPCName+" API connection not found", err, resInfo)
+ attrs = trace.StatusCodeInternal(err.Error())
+ case errors.Is(err, context.Canceled):
+ err = status.WrapWithCanceled(vald.IndexDetailRPCName+" API canceled", err, resInfo)
+ attrs = trace.StatusCodeCancelled(err.Error())
+ case errors.Is(err, context.DeadlineExceeded):
+ err = status.WrapWithDeadlineExceeded(vald.IndexDetailRPCName+" API deadline exceeded", err, resInfo)
+ attrs = trace.StatusCodeDeadlineExceeded(err.Error())
+ default:
+ var (
+ st *status.Status
+ msg string
+ )
+ st, msg, err = status.ParseError(err, codes.Unknown, vald.IndexDetailRPCName+" API request returned error", resInfo)
+ attrs = trace.FromGRPCStatus(st.Code(), msg)
+ }
+ log.Debug(err)
+ if span != nil {
+ span.RecordError(err)
+ span.SetAttributes(attrs...)
+ span.SetStatus(trace.StatusError, err.Error())
+ }
+ return nil, err
+ }
+ return detail, nil
+}
+
+func (s *server) GetTimestamp(
+ ctx context.Context, req *payload.Object_TimestampRequest,
+) (ts *payload.Object_Timestamp, err error) {
+ ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.ObjectRPCServiceName+"/"+vald.GetTimestampRPCName), apiName+"/"+vald.GetTimestampRPCName)
+ defer func() {
+ if span != nil {
+ span.End()
+ }
+ }()
+ uuid := req.GetId().GetId()
+ tch := make(chan *payload.Object_Timestamp, 1)
+ ech := make(chan error, 1)
+ doneErr := errors.New("done getTimestamp")
+ ctx, cancel := context.WithCancelCause(ctx)
+ s.eg.Go(safety.RecoverFunc(func() error {
+ defer close(tch)
+ defer close(ech)
+ var once sync.Once
+ ech <- s.gateway.BroadCast(ctx, service.READ, func(ctx context.Context, target string, vc vald.Client, copts ...grpc.CallOption) error {
+ sctx, sspan := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "BroadCast/"+target), apiName+"/getTimestamp/BroadCast/"+target)
+ defer func() {
+ if sspan != nil {
+ sspan.End()
+ }
+ }()
+ req := &payload.Object_TimestampRequest{
+ Id: &payload.Object_ID{
+ Id: uuid,
+ },
+ }
+ ots, err := vc.GetTimestamp(sctx, req, copts...)
+ if err != nil {
+ var (
+ attrs trace.Attributes
+ st *status.Status
+ msg string
+ code codes.Code
+ )
+ switch {
+ case errors.Is(err, context.Canceled),
+ errors.Is(err, errors.ErrRPCCallFailed(target, context.Canceled)):
+ attrs = trace.StatusCodeCancelled(
+ errdetails.ValdGRPCResourceTypePrefix +
+ "/vald.v1." + vald.GetTimestampRPCName + ".BroadCast/" +
+ target + " canceled: " + err.Error())
+ code = codes.Canceled
+ case errors.Is(err, context.DeadlineExceeded),
+ errors.Is(err, errors.ErrRPCCallFailed(target, context.DeadlineExceeded)):
+ attrs = trace.StatusCodeDeadlineExceeded(
+ errdetails.ValdGRPCResourceTypePrefix +
+ "/vald.v1." + vald.GetTimestampRPCName + ".BroadCast/" +
+ target + " deadline_exceeded: " + err.Error())
+ code = codes.DeadlineExceeded
+ default:
+ st, msg, err = status.ParseError(err, codes.NotFound, "error "+vald.GetTimestampRPCName+" API meta "+uuid+"'s uuid not found",
+ &errdetails.RequestInfo{
+ RequestId: uuid,
+ ServingData: errdetails.Serialize(req),
+ },
+ &errdetails.ResourceInfo{
+ ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.GetTimestampRPCName,
+ ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target),
+ })
+ if st != nil {
+ code = st.Code()
+ } else {
+ code = codes.NotFound
+ }
+ attrs = trace.FromGRPCStatus(code, msg)
+ }
+ if sspan != nil {
+ sspan.RecordError(err)
+ sspan.SetAttributes(attrs...)
+ sspan.SetStatus(trace.StatusError, err.Error())
+ }
+ if err != nil && st != nil &&
+ code != codes.Canceled &&
+ code != codes.DeadlineExceeded &&
+ code != codes.InvalidArgument &&
+ code != codes.NotFound &&
+ code != codes.OK &&
+ code != codes.Unimplemented {
+ return err
+ }
+ return nil
+ }
+ if ots != nil && ots.GetId() != "" {
+ once.Do(func() {
+ tch <- ots
+ cancel(doneErr)
+ })
+ }
+ return nil
+ })
+ return nil
+ }))
+ select {
+ case <-ctx.Done():
+ err = ctx.Err()
+ if errors.Is(err, context.Canceled) && errors.Is(context.Cause(ctx), doneErr) {
+ select {
+ case ts = <-tch:
+ if ts == nil || ts.GetId() == "" {
+ err = errors.ErrObjectNotFound(nil, uuid)
+ } else {
+ err = nil
+ }
+ default:
+ }
+ }
+ case ts = <-tch:
+ if ts == nil || ts.GetId() == "" {
+ err = errors.ErrObjectNotFound(nil, uuid)
+ }
+ case err = <-ech:
+ }
+ if err != nil {
+ reqInfo := &errdetails.RequestInfo{
+ RequestId: uuid,
+ ServingData: errdetails.Serialize(req),
+ }
+ resInfo := &errdetails.ResourceInfo{
+ ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.GetTimestampRPCName,
+ ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)),
+ }
+ var attrs trace.Attributes
+ switch {
+ case errors.Is(err, errors.ErrInvalidUUID(uuid)):
+ err = status.WrapWithInvalidArgument(vald.GetTimestampRPCName+" API invalid argument for uuid \""+uuid+"\" detected", err, reqInfo, resInfo, &errdetails.BadRequest{
+ FieldViolations: []*errdetails.BadRequestFieldViolation{
+ {
+ Field: "uuid",
+ Description: err.Error(),
+ },
+ },
+ })
+ attrs = trace.StatusCodeInvalidArgument(err.Error())
+ case errors.Is(err, errors.ErrObjectIDNotFound(uuid)), errors.Is(err, errors.ErrObjectNotFound(nil, uuid)):
+ err = status.WrapWithNotFound(vald.GetTimestampRPCName+" API id "+uuid+"'s object not found", err, reqInfo, resInfo)
+ attrs = trace.StatusCodeNotFound(err.Error())
+ case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")):
+ err = status.WrapWithInternal(vald.GetTimestampRPCName+" API connection not found", err, reqInfo, resInfo)
+ attrs = trace.StatusCodeInternal(err.Error())
+ case errors.Is(err, context.Canceled):
+ err = status.WrapWithCanceled(vald.GetTimestampRPCName+" API canceled", err, reqInfo, resInfo)
+ attrs = trace.StatusCodeCancelled(err.Error())
+ case errors.Is(err, context.DeadlineExceeded):
+ err = status.WrapWithDeadlineExceeded(vald.GetTimestampRPCName+" API deadline exceeded", err, reqInfo, resInfo)
+ attrs = trace.StatusCodeDeadlineExceeded(err.Error())
+ default:
+ var (
+ st *status.Status
+ msg string
+ )
+ st, msg, err = status.ParseError(err, codes.Unknown, vald.GetTimestampRPCName+" API uuid "+uuid+"'s request returned error", reqInfo, resInfo)
+ attrs = trace.FromGRPCStatus(st.Code(), msg)
+ }
+ if span != nil {
+ span.RecordError(err)
+ span.SetAttributes(attrs...)
+ span.SetStatus(trace.StatusError, err.Error())
+ }
+ return nil, err
+ }
+ return ts, nil
+}
diff --git a/pkg/gateway/lb/handler/grpc/search_benchmark_test.go b/pkg/gateway/lb/handler/grpc/search_benchmark_test.go
index 7251d07273..06a2287980 100644
--- a/pkg/gateway/lb/handler/grpc/search_benchmark_test.go
+++ b/pkg/gateway/lb/handler/grpc/search_benchmark_test.go
@@ -86,7 +86,9 @@ func newRandomResponse() (res *payload.Search_Response) {
return res
}
-func benchmark(b *testing.B, results []*payload.Search_Response, anew func(n, f, r int) Aggregator) {
+func benchmark(
+ b *testing.B, results []*payload.Search_Response, anew func(n, f, r int) Aggregator,
+) {
ctx := context.Background()
l := len(results)
for k := 10; k < dataLength; k *= 10 {
@@ -113,7 +115,10 @@ func benchmark(b *testing.B, results []*payload.Search_Response, anew func(n, f,
}
}
-func doSearchWithAggregator(ctx context.Context, k, concurrency int, anew func(n, f, r int) Aggregator,
+func doSearchWithAggregator(
+ ctx context.Context,
+ k, concurrency int,
+ anew func(n, f, r int) Aggregator,
f func(ctx context.Context) *payload.Search_Response,
) (res *payload.Search_Response, err error) {
eg, ectx := errgroup.New(ctx)
diff --git a/pkg/gateway/lb/handler/rest/handler.go b/pkg/gateway/lb/handler/rest/handler.go
index 83a7607453..49a6947209 100644
--- a/pkg/gateway/lb/handler/rest/handler.go
+++ b/pkg/gateway/lb/handler/rest/handler.go
@@ -63,141 +63,143 @@ func New(opts ...Option) Handler {
}
func (*handler) Index(w http.ResponseWriter, r *http.Request) (int, error) {
- data := make(map[string]interface{})
- return json.Handler(w, r, &data, func() (interface{}, error) {
+ data := make(map[string]any)
+ return json.Handler(w, r, &data, func() (any, error) {
return dump.Request(nil, data, r)
})
}
func (h *handler) Search(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.Search(r.Context(), req)
})
}
func (h *handler) SearchByID(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_IDRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.SearchByID(r.Context(), req)
})
}
func (h *handler) MultiSearch(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_MultiRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.MultiSearch(r.Context(), req)
})
}
func (h *handler) MultiSearchByID(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_MultiIDRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.MultiSearchByID(r.Context(), req)
})
}
func (h *handler) LinearSearch(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.LinearSearch(r.Context(), req)
})
}
func (h *handler) LinearSearchByID(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_IDRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.LinearSearchByID(r.Context(), req)
})
}
func (h *handler) MultiLinearSearch(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_MultiRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.MultiLinearSearch(r.Context(), req)
})
}
-func (h *handler) MultiLinearSearchByID(w http.ResponseWriter, r *http.Request) (code int, err error) {
+func (h *handler) MultiLinearSearchByID(
+ w http.ResponseWriter, r *http.Request,
+) (code int, err error) {
var req *payload.Search_MultiIDRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.MultiLinearSearchByID(r.Context(), req)
})
}
func (h *handler) Insert(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Insert_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.Insert(r.Context(), req)
})
}
func (h *handler) MultiInsert(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Insert_MultiRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.MultiInsert(r.Context(), req)
})
}
func (h *handler) Update(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Update_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.Update(r.Context(), req)
})
}
func (h *handler) MultiUpdate(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Update_MultiRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.MultiUpdate(r.Context(), req)
})
}
func (h *handler) Upsert(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Upsert_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.Upsert(r.Context(), req)
})
}
func (h *handler) MultiUpsert(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Upsert_MultiRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.MultiUpsert(r.Context(), req)
})
}
func (h *handler) Remove(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Remove_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.Remove(r.Context(), req)
})
}
func (h *handler) MultiRemove(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Remove_MultiRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.MultiRemove(r.Context(), req)
})
}
func (h *handler) Flush(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Flush_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.Flush(r.Context(), req)
})
}
func (h *handler) GetObject(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Object_VectorRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.GetObject(r.Context(), req)
})
}
func (h *handler) Exists(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Object_ID
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.Exists(r.Context(), req)
})
}
diff --git a/pkg/gateway/lb/router/option.go b/pkg/gateway/lb/router/option.go
index 4c67a79325..e10f854aa6 100644
--- a/pkg/gateway/lb/router/option.go
+++ b/pkg/gateway/lb/router/option.go
@@ -17,9 +17,7 @@
// Package router provides implementation of Go API for routing http Handler wrapped by rest.Func
package router
-import (
- "github.com/vdaas/vald/pkg/gateway/lb/handler/rest"
-)
+import "github.com/vdaas/vald/pkg/gateway/lb/handler/rest"
type Option func(*router)
diff --git a/pkg/gateway/lb/service/gateway.go b/pkg/gateway/lb/service/gateway.go
index 8ae522c9ff..53c259c9e1 100644
--- a/pkg/gateway/lb/service/gateway.go
+++ b/pkg/gateway/lb/service/gateway.go
@@ -67,7 +67,9 @@ func (g *gateway) Start(ctx context.Context) (<-chan error, error) {
return g.client.Start(ctx)
}
-func (g *gateway) BroadCast(ctx context.Context, kind BroadCastKind,
+func (g *gateway) BroadCast(
+ ctx context.Context,
+ kind BroadCastKind,
f func(ctx context.Context, target string, ac vald.Client, copts ...grpc.CallOption) error,
) (err error) {
fctx, span := trace.StartSpan(ctx, "vald/gateway-lb/service/Gateway.BroadCast")
@@ -101,7 +103,9 @@ func (g *gateway) BroadCast(ctx context.Context, kind BroadCastKind,
})
}
-func (g *gateway) DoMulti(ctx context.Context, num int,
+func (g *gateway) DoMulti(
+ ctx context.Context,
+ num int,
f func(ctx context.Context, target string, ac vald.Client, copts ...grpc.CallOption) error,
) (err error) {
sctx, span := trace.StartSpan(ctx, "vald/gateway-lb/service/Gateway.DoMulti")
diff --git a/pkg/gateway/lb/usecase/vald.go b/pkg/gateway/lb/usecase/vald.go
index b348b66639..66b0474415 100644
--- a/pkg/gateway/lb/usecase/vald.go
+++ b/pkg/gateway/lb/usecase/vald.go
@@ -46,7 +46,9 @@ type run struct {
gateway service.Gateway
}
-func discovererClient(cfg *config.Data, dopts, aopts []grpc.Option, eg errgroup.Group) (discoverer.Client, error) {
+func discovererClient(
+ cfg *config.Data, dopts, aopts []grpc.Option, eg errgroup.Group,
+) (discoverer.Client, error) {
var discovererOpts []discoverer.Option
discovererOpts = append(discovererOpts,
discoverer.WithAutoConnect(true),
diff --git a/pkg/gateway/mirror/handler/grpc/handler.go b/pkg/gateway/mirror/handler/grpc/handler.go
index edafb8e872..45226b4806 100644
--- a/pkg/gateway/mirror/handler/grpc/handler.go
+++ b/pkg/gateway/mirror/handler/grpc/handler.go
@@ -75,7 +75,9 @@ func New(opts ...Option) (Server, error) {
// Register handles the registration of mirror targets.
// The function connects to the mirror using the provided targets, and if successful,
// returns the addresses of connected Mirror gateways.
-func (s *server) Register(ctx context.Context, req *payload.Mirror_Targets) (*payload.Mirror_Targets, error) {
+func (s *server) Register(
+ ctx context.Context, req *payload.Mirror_Targets,
+) (*payload.Mirror_Targets, error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+mirror.RPCServiceName+"/"+mirror.RegisterRPCName), apiName+"/"+mirror.RegisterRPCName)
defer func() {
if span != nil {
@@ -164,7 +166,9 @@ func (s *server) Register(ctx context.Context, req *payload.Mirror_Targets) (*pa
}
// Exists bypasses the incoming Exist request to Vald gateway (LB gateway) in its own cluster.
-func (s *server) Exists(ctx context.Context, meta *payload.Object_ID) (id *payload.Object_ID, err error) {
+func (s *server) Exists(
+ ctx context.Context, meta *payload.Object_ID,
+) (id *payload.Object_ID, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.ObjectRPCServiceName+"/"+vald.ExistsRPCName), apiName+"/"+vald.ExistsRPCName)
defer func() {
if span != nil {
@@ -172,7 +176,7 @@ func (s *server) Exists(ctx context.Context, meta *payload.Object_ID) (id *paylo
}
}()
- _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (interface{}, error) {
+ _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (any, error) {
id, err = vc.Exists(ctx, meta, copts...)
return id, err
})
@@ -229,7 +233,9 @@ func (s *server) Exists(ctx context.Context, meta *payload.Object_ID) (id *paylo
}
// Search bypasses the incoming Search request to Vald gateway (LB gateway) in its own cluster.
-func (s *server) Search(ctx context.Context, req *payload.Search_Request) (res *payload.Search_Response, err error) {
+func (s *server) Search(
+ ctx context.Context, req *payload.Search_Request,
+) (res *payload.Search_Response, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.SearchRPCName), apiName+"/"+vald.SearchRPCName)
defer func() {
if span != nil {
@@ -237,7 +243,7 @@ func (s *server) Search(ctx context.Context, req *payload.Search_Request) (res *
}
}()
- _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (interface{}, error) {
+ _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (any, error) {
res, err = vc.Search(ctx, req, copts...)
return res, err
})
@@ -295,9 +301,9 @@ func (s *server) Search(ctx context.Context, req *payload.Search_Request) (res *
}
// SearchByID bypasses the incoming SearchByID request to Vald gateway (LB gateway) in its own cluster.
-func (s *server) SearchByID(ctx context.Context, req *payload.Search_IDRequest) (
- res *payload.Search_Response, err error,
-) {
+func (s *server) SearchByID(
+ ctx context.Context, req *payload.Search_IDRequest,
+) (res *payload.Search_Response, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.SearchByIDRPCName), apiName+"/"+vald.SearchByIDRPCName)
defer func() {
if span != nil {
@@ -305,7 +311,7 @@ func (s *server) SearchByID(ctx context.Context, req *payload.Search_IDRequest)
}
}()
- _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (interface{}, error) {
+ _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (any, error) {
res, err = vc.SearchByID(ctx, req, copts...)
return res, err
})
@@ -463,7 +469,9 @@ func (s *server) StreamSearchByID(stream vald.Search_StreamSearchByIDServer) (er
}
// MultiSearch bypasses the incoming MultiSearch request to Vald gateway (LB gateway) in its own cluster.
-func (s *server) MultiSearch(ctx context.Context, req *payload.Search_MultiRequest) (res *payload.Search_Responses, err error) {
+func (s *server) MultiSearch(
+ ctx context.Context, req *payload.Search_MultiRequest,
+) (res *payload.Search_Responses, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.MultiSearchRPCName), apiName+"/"+vald.MultiSearchRPCName)
defer func() {
if span != nil {
@@ -471,7 +479,7 @@ func (s *server) MultiSearch(ctx context.Context, req *payload.Search_MultiReque
}
}()
- _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (interface{}, error) {
+ _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (any, error) {
res, err = vc.MultiSearch(ctx, req, copts...)
return res, err
})
@@ -528,7 +536,9 @@ func (s *server) MultiSearch(ctx context.Context, req *payload.Search_MultiReque
}
// MultiSearchByID bypasses the incoming MultiSearchByID request to Vald gateway (LB gateway) in its own cluster.
-func (s *server) MultiSearchByID(ctx context.Context, req *payload.Search_MultiIDRequest) (res *payload.Search_Responses, err error) {
+func (s *server) MultiSearchByID(
+ ctx context.Context, req *payload.Search_MultiIDRequest,
+) (res *payload.Search_Responses, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.MultiSearchByIDRPCName), apiName+"/"+vald.MultiSearchByIDRPCName)
defer func() {
if span != nil {
@@ -536,7 +546,7 @@ func (s *server) MultiSearchByID(ctx context.Context, req *payload.Search_MultiI
}
}()
- _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (interface{}, error) {
+ _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (any, error) {
res, err = vc.MultiSearchByID(ctx, req, copts...)
return res, err
})
@@ -593,7 +603,9 @@ func (s *server) MultiSearchByID(ctx context.Context, req *payload.Search_MultiI
}
// LinearSearch bypasses the incoming LinearSearch request to Vald gateway (LB gateway) in its own cluster.
-func (s *server) LinearSearch(ctx context.Context, req *payload.Search_Request) (res *payload.Search_Response, err error) {
+func (s *server) LinearSearch(
+ ctx context.Context, req *payload.Search_Request,
+) (res *payload.Search_Response, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.LinearSearchRPCName), apiName+"/"+vald.LinearSearchRPCName)
defer func() {
if span != nil {
@@ -601,7 +613,7 @@ func (s *server) LinearSearch(ctx context.Context, req *payload.Search_Request)
}
}()
- _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (interface{}, error) {
+ _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (any, error) {
res, err = vc.LinearSearch(ctx, req, copts...)
return res, err
})
@@ -659,9 +671,9 @@ func (s *server) LinearSearch(ctx context.Context, req *payload.Search_Request)
}
// LinearSearchByID bypasses the incoming LinearSearchByID request to Vald gateway (LB gateway) in its own cluster.
-func (s *server) LinearSearchByID(ctx context.Context, req *payload.Search_IDRequest) (
- res *payload.Search_Response, err error,
-) {
+func (s *server) LinearSearchByID(
+ ctx context.Context, req *payload.Search_IDRequest,
+) (res *payload.Search_Response, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.LinearSearchByIDRPCName), apiName+"/"+vald.LinearSearchByIDRPCName)
defer func() {
if span != nil {
@@ -669,7 +681,7 @@ func (s *server) LinearSearchByID(ctx context.Context, req *payload.Search_IDReq
}
}()
- _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (interface{}, error) {
+ _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (any, error) {
res, err = vc.LinearSearchByID(ctx, req, copts...)
return res, err
})
@@ -777,7 +789,9 @@ func (s *server) StreamLinearSearch(stream vald.Search_StreamLinearSearchServer)
}
// StreamLinearSearchByID bypasses it as a LinearSearchByID request to Vald gateway (LB gateway) in its own cluster.
-func (s *server) StreamLinearSearchByID(stream vald.Search_StreamLinearSearchByIDServer) (err error) {
+func (s *server) StreamLinearSearchByID(
+ stream vald.Search_StreamLinearSearchByIDServer,
+) (err error) {
ctx, span := trace.StartSpan(
grpc.WithGRPCMethod(stream.Context(), vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.StreamLinearSearchByIDRPCName),
apiName+"/"+vald.StreamLinearSearchByIDRPCName,
@@ -830,7 +844,9 @@ func (s *server) StreamLinearSearchByID(stream vald.Search_StreamLinearSearchByI
}
// MultiLinearSearch bypasses the incoming MultiLinearSearch request to Vald gateway (LB gateway) in its own cluster.
-func (s *server) MultiLinearSearch(ctx context.Context, req *payload.Search_MultiRequest) (res *payload.Search_Responses, err error) {
+func (s *server) MultiLinearSearch(
+ ctx context.Context, req *payload.Search_MultiRequest,
+) (res *payload.Search_Responses, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.MultiLinearSearchRPCName), apiName+"/"+vald.MultiLinearSearchRPCName)
defer func() {
if span != nil {
@@ -838,7 +854,7 @@ func (s *server) MultiLinearSearch(ctx context.Context, req *payload.Search_Mult
}
}()
- _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (interface{}, error) {
+ _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (any, error) {
res, err = vc.MultiLinearSearch(ctx, req, copts...)
return res, err
})
@@ -895,7 +911,9 @@ func (s *server) MultiLinearSearch(ctx context.Context, req *payload.Search_Mult
}
// MultiLinearSearchByID bypasses the incoming MultiLinearSearchByID request to Vald gateway (LB gateway) in its own cluster.
-func (s *server) MultiLinearSearchByID(ctx context.Context, req *payload.Search_MultiIDRequest) (res *payload.Search_Responses, err error) {
+func (s *server) MultiLinearSearchByID(
+ ctx context.Context, req *payload.Search_MultiIDRequest,
+) (res *payload.Search_Responses, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.MultiLinearSearchByIDRPCName), apiName+"/"+vald.MultiLinearSearchByIDRPCName)
defer func() {
if span != nil {
@@ -903,7 +921,7 @@ func (s *server) MultiLinearSearchByID(ctx context.Context, req *payload.Search_
}
}()
- _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (interface{}, error) {
+ _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (any, error) {
res, err = vc.MultiLinearSearchByID(ctx, req, copts...)
return res, err
})
@@ -963,7 +981,9 @@ func (s *server) MultiLinearSearchByID(ctx context.Context, req *payload.Search_
// If the request is proxied from another Mirror gateway, the request is forwarded to the Vald gateway (LB gateway) of its own cluster.
// If the request is from a user, it is sent to other Mirror gateways and the Vald gateway (LB gateway) of its own cluster.
// The result is a location of the inserted object.
-func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc *payload.Object_Location, err error) {
+func (s *server) Insert(
+ ctx context.Context, req *payload.Insert_Request,
+) (loc *payload.Object_Location, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.InsertRPCServiceName+"/"+vald.InsertRPCName), apiName+"/"+vald.InsertRPCName)
defer func() {
if span != nil {
@@ -975,7 +995,7 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc *
// So this component sends requests only to the Vald gateway (LB gateway) of its own cluster.
if s.isProxied(ctx) {
loc, err = s.doInsert(ctx, req, func(ctx context.Context) (*payload.Object_Location, error) {
- _, derr := s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (interface{}, error) {
+ _, derr := s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (any, error) {
loc, err = vc.Insert(ctx, req, copts...)
return loc, err
})
@@ -1009,7 +1029,9 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc *
return s.handleInsert(ctx, req)
}
-func (s *server) handleInsert(ctx context.Context, req *payload.Insert_Request) (loc *payload.Object_Location, err error) { // skipcq: GO-R1005
+func (s *server) handleInsert(
+ ctx context.Context, req *payload.Insert_Request,
+) (loc *payload.Object_Location, err error) { // skipcq: GO-R1005
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, "handleInsert"), apiName+"/handleInsert")
defer func() {
if span != nil {
@@ -1168,7 +1190,8 @@ func (s *server) handleInsert(ctx context.Context, req *payload.Insert_Request)
return loc, nil
}
-func (s *server) handleInsertResult( // skipcq: GO-R1005
+func (s *server) handleInsertResult(
+ // skipcq: GO-R1005
ctx context.Context,
alreadyExistsTgts []string,
req *payload.Update_Request,
@@ -1318,7 +1341,11 @@ func (s *server) handleInsertResult( // skipcq: GO-R1005
return loc, nil
}
-func (s *server) doInsert(ctx context.Context, req *payload.Insert_Request, f func(ctx context.Context) (*payload.Object_Location, error)) (loc *payload.Object_Location, err error) {
+func (s *server) doInsert(
+ ctx context.Context,
+ req *payload.Insert_Request,
+ f func(ctx context.Context) (*payload.Object_Location, error),
+) (loc *payload.Object_Location, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "doInsert"), apiName+"/doInsert")
defer func() {
if span != nil {
@@ -1435,7 +1462,9 @@ func (s *server) StreamInsert(stream vald.Insert_StreamInsertServer) (err error)
// MultiInsert handles the insertion of multiple objects with the given requests.
// For each request in parallel, it calls the Insert function to insert an object.
// If an error occurs during any of the insertions, it accumulates the errors and returns them along with the successfully inserted locations.
-func (s *server) MultiInsert(ctx context.Context, reqs *payload.Insert_MultiRequest) (res *payload.Object_Locations, errs error) {
+func (s *server) MultiInsert(
+ ctx context.Context, reqs *payload.Insert_MultiRequest,
+) (res *payload.Object_Locations, errs error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.InsertRPCServiceName+"/"+vald.MultiInsertRPCName), apiName+"/"+vald.MultiInsertRPCName)
defer func() {
if span != nil {
@@ -1507,7 +1536,9 @@ func (s *server) MultiInsert(ctx context.Context, reqs *payload.Insert_MultiRequ
// If the request is proxied from another Mirror gateway, it sends the request only to the Vald gateway (LB gateway) of its own cluster.
// If the request is from a user, it sends requests to other Mirror gateways and the Vald gateway (LB gateway) of its own cluster.
// The result is a location of the updated object.
-func (s *server) Update(ctx context.Context, req *payload.Update_Request) (loc *payload.Object_Location, err error) {
+func (s *server) Update(
+ ctx context.Context, req *payload.Update_Request,
+) (loc *payload.Object_Location, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.UpdateRPCServiceName+"/"+vald.UpdateRPCName), apiName+"/"+vald.UpdateRPCName)
defer func() {
if span != nil {
@@ -1519,7 +1550,7 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (loc *
// So this component sends requests only to the Vald gateway (LB gateway) of its own cluster.
if s.isProxied(ctx) {
loc, err = s.doUpdate(ctx, req, func(ctx context.Context) (*payload.Object_Location, error) {
- _, derr := s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (interface{}, error) {
+ _, derr := s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (any, error) {
loc, err = vc.Update(ctx, req, copts...)
return loc, err
})
@@ -1553,7 +1584,9 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (loc *
return s.handleUpdate(ctx, req)
}
-func (s *server) handleUpdate(ctx context.Context, req *payload.Update_Request) (loc *payload.Object_Location, err error) { // skipcq: GO-R1005
+func (s *server) handleUpdate(
+ ctx context.Context, req *payload.Update_Request,
+) (loc *payload.Object_Location, err error) { // skipcq: GO-R1005
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, "handleUpdate"), apiName+"/handleUpdate")
defer func() {
if span != nil {
@@ -1727,7 +1760,8 @@ func (s *server) handleUpdate(ctx context.Context, req *payload.Update_Request)
return loc, nil
}
-func (s *server) handleUpdateResult( // skipcq: GO-R1005
+func (s *server) handleUpdateResult(
+ // skipcq: GO-R1005
ctx context.Context,
notFoundTgts []string,
req *payload.Insert_Request,
@@ -1892,7 +1926,11 @@ func (s *server) handleUpdateResult( // skipcq: GO-R1005
return loc, nil
}
-func (s *server) doUpdate(ctx context.Context, req *payload.Update_Request, f func(ctx context.Context) (*payload.Object_Location, error)) (loc *payload.Object_Location, err error) {
+func (s *server) doUpdate(
+ ctx context.Context,
+ req *payload.Update_Request,
+ f func(ctx context.Context) (*payload.Object_Location, error),
+) (loc *payload.Object_Location, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "doUpdate"), apiName+"/doUpdate")
defer func() {
if span != nil {
@@ -2009,7 +2047,9 @@ func (s *server) StreamUpdate(stream vald.Update_StreamUpdateServer) (err error)
// MultiUpdate handles the update of multiple objects with the given requests.
// For each request in parallel, it calls the Update function to update an object.
// If an error occurs during any of the insertions, it accumulates the errors and returns them along with the successfully updated locations.
-func (s *server) MultiUpdate(ctx context.Context, reqs *payload.Update_MultiRequest) (res *payload.Object_Locations, errs error) {
+func (s *server) MultiUpdate(
+ ctx context.Context, reqs *payload.Update_MultiRequest,
+) (res *payload.Object_Locations, errs error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.UpdateRPCServiceName+"/"+vald.MultiUpdateRPCName), apiName+"/"+vald.MultiUpdateRPCName)
defer func() {
if span != nil {
@@ -2081,7 +2121,9 @@ func (s *server) MultiUpdate(ctx context.Context, reqs *payload.Update_MultiRequ
// If the request is proxied from another Mirror gateway, the request is forwarded to the Vald gateway (LB gateway) of its own cluster.
// If the request is from a user, it is sent to other Mirror gateways and the Vald gateway (LB gateway) of its own cluster.
// The result is a location of the upserted object.
-func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc *payload.Object_Location, err error) {
+func (s *server) Upsert(
+ ctx context.Context, req *payload.Upsert_Request,
+) (loc *payload.Object_Location, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.UpsertRPCServiceName+"/"+vald.UpsertRPCName), apiName+"/"+vald.UpsertRPCName)
defer func() {
if span != nil {
@@ -2093,7 +2135,7 @@ func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc *
// So this component sends requests only to the Vald gateway (LB gateway) of its own cluster.
if s.isProxied(ctx) {
loc, err = s.doUpsert(ctx, req, func(ctx context.Context) (*payload.Object_Location, error) {
- s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (interface{}, error) {
+ s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (any, error) {
loc, err = vc.Upsert(ctx, req, copts...)
return loc, err
})
@@ -2128,7 +2170,9 @@ func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc *
return s.handleUpsert(ctx, req)
}
-func (s *server) handleUpsert(ctx context.Context, req *payload.Upsert_Request) (loc *payload.Object_Location, err error) { // skipcq: GO-R1005
+func (s *server) handleUpsert(
+ ctx context.Context, req *payload.Upsert_Request,
+) (loc *payload.Object_Location, err error) { // skipcq: GO-R1005
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, "handleUpsert"), apiName+"/handleUpsert")
defer func() {
if span != nil {
@@ -2272,7 +2316,11 @@ func (s *server) handleUpsert(ctx context.Context, req *payload.Upsert_Request)
}
}
-func (s *server) doUpsert(ctx context.Context, req *payload.Upsert_Request, f func(ctx context.Context) (*payload.Object_Location, error)) (loc *payload.Object_Location, err error) {
+func (s *server) doUpsert(
+ ctx context.Context,
+ req *payload.Upsert_Request,
+ f func(ctx context.Context) (*payload.Object_Location, error),
+) (loc *payload.Object_Location, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "doUpsert"), apiName+"/doUpsert")
defer func() {
if span != nil {
@@ -2389,7 +2437,9 @@ func (s *server) StreamUpsert(stream vald.Upsert_StreamUpsertServer) (err error)
// MultiUpsert handles the upsert of multiple objects with the given requests.
// For each request in parallel, it calls the Upsert function to upsert an object.
// If an error occurs during any of the insertions, it accumulates the errors and returns them along with the successfully upserted locations.
-func (s *server) MultiUpsert(ctx context.Context, reqs *payload.Upsert_MultiRequest) (res *payload.Object_Locations, errs error) {
+func (s *server) MultiUpsert(
+ ctx context.Context, reqs *payload.Upsert_MultiRequest,
+) (res *payload.Object_Locations, errs error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.UpsertRPCServiceName+"/"+vald.MultiUpsertRPCName), apiName+"/"+vald.MultiUpsertRPCName)
defer func() {
if span != nil {
@@ -2461,7 +2511,9 @@ func (s *server) MultiUpsert(ctx context.Context, reqs *payload.Upsert_MultiRequ
// If the request is proxied from another Mirror gateway, the request is forwarded to the Vald gateway (LB gateway) of its own cluster.
// If the request is from a user, it is sent to other Mirror gateways and the Vald gateway (LB gateway) of its own cluster.
// The result is a location of the removed object.
-func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (loc *payload.Object_Location, err error) {
+func (s *server) Remove(
+ ctx context.Context, req *payload.Remove_Request,
+) (loc *payload.Object_Location, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.RemoveRPCServiceName+"/"+vald.RemoveRPCName), apiName+"/"+vald.RemoveRPCName)
defer func() {
if span != nil {
@@ -2473,7 +2525,7 @@ func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (loc *
// So this component sends requests only to the Vald gateway (LB gateway) of its own cluster.
if s.isProxied(ctx) {
loc, err = s.doRemove(ctx, req, func(ctx context.Context) (*payload.Object_Location, error) {
- s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (interface{}, error) {
+ s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (any, error) {
loc, err = vc.Remove(ctx, req, copts...)
return loc, err
})
@@ -2507,7 +2559,9 @@ func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (loc *
return s.handleRemove(ctx, req)
}
-func (s *server) handleRemove(ctx context.Context, req *payload.Remove_Request) (loc *payload.Object_Location, err error) { // skipcq: GO-R1005
+func (s *server) handleRemove(
+ ctx context.Context, req *payload.Remove_Request,
+) (loc *payload.Object_Location, err error) { // skipcq: GO-R1005
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, "handleRemove"), apiName+"/handleRemove")
defer func() {
if span != nil {
@@ -2648,7 +2702,11 @@ func (s *server) handleRemove(ctx context.Context, req *payload.Remove_Request)
}
}
-func (s *server) doRemove(ctx context.Context, req *payload.Remove_Request, f func(ctx context.Context) (*payload.Object_Location, error)) (loc *payload.Object_Location, err error) {
+func (s *server) doRemove(
+ ctx context.Context,
+ req *payload.Remove_Request,
+ f func(ctx context.Context) (*payload.Object_Location, error),
+) (loc *payload.Object_Location, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "doRemove"), apiName+"/doRemove")
defer func() {
if span != nil {
@@ -2764,7 +2822,9 @@ func (s *server) StreamRemove(stream vald.Remove_StreamRemoveServer) (err error)
// MultiRemove handles the remove of multiple objects with the given requests.
// For each request in parallel, it calls the Remove function to insert an object.
// If an error occurs during any of the insertions, it accumulates the errors and returns them along with the successfully removed locations.
-func (s *server) MultiRemove(ctx context.Context, reqs *payload.Remove_MultiRequest) (res *payload.Object_Locations, errs error) {
+func (s *server) MultiRemove(
+ ctx context.Context, reqs *payload.Remove_MultiRequest,
+) (res *payload.Object_Locations, errs error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.RemoveRPCServiceName+"/"+vald.MultiRemoveRPCName), apiName+"/"+vald.MultiRemoveRPCName)
defer func() {
if span != nil {
@@ -2836,7 +2896,9 @@ func (s *server) MultiRemove(ctx context.Context, reqs *payload.Remove_MultiRequ
// If the request is proxied from another Mirror gateway, the request is forwarded to the Vald gateway (LB gateway) of its own cluster.
// If the request is from a user, it is sent to other Mirror gateways and the Vald gateway (LB gateway) of its own cluster.
// The result is a location of the removed object.
-func (s *server) RemoveByTimestamp(ctx context.Context, req *payload.Remove_TimestampRequest) (locs *payload.Object_Locations, err error) {
+func (s *server) RemoveByTimestamp(
+ ctx context.Context, req *payload.Remove_TimestampRequest,
+) (locs *payload.Object_Locations, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.RemoveRPCServiceName+"/"+vald.RemoveByTimestampRPCName), apiName+"/"+vald.RemoveByTimestampRPCName)
defer func() {
if span != nil {
@@ -2848,7 +2910,7 @@ func (s *server) RemoveByTimestamp(ctx context.Context, req *payload.Remove_Time
// So this component sends requests only to the Vald gateway (LB gateway) of its own cluster.
if s.isProxied(ctx) {
locs, err = s.doRemoveByTimestamp(ctx, req, func(ctx context.Context) (*payload.Object_Locations, error) {
- _, derr := s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (interface{}, error) {
+ _, derr := s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (any, error) {
locs, err = vc.RemoveByTimestamp(ctx, req, copts...)
return locs, err
})
@@ -2882,7 +2944,9 @@ func (s *server) RemoveByTimestamp(ctx context.Context, req *payload.Remove_Time
return s.handleRemoveByTimestamp(ctx, req)
}
-func (s *server) handleRemoveByTimestamp(ctx context.Context, req *payload.Remove_TimestampRequest) (locs *payload.Object_Locations, err error) { // skipcq: GO-R1005
+func (s *server) handleRemoveByTimestamp(
+ ctx context.Context, req *payload.Remove_TimestampRequest,
+) (locs *payload.Object_Locations, err error) { // skipcq: GO-R1005
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, "handleRemoveByTimestamp"), apiName+"/handleRemoveByTimestamp")
defer func() {
if span != nil {
@@ -3084,7 +3148,9 @@ func (s *server) doRemoveByTimestamp(
}
// GetObject bypasses the incoming GetObject request to Vald LB gateway in its own cluster.
-func (s *server) GetObject(ctx context.Context, req *payload.Object_VectorRequest) (vec *payload.Object_Vector, err error) {
+func (s *server) GetObject(
+ ctx context.Context, req *payload.Object_VectorRequest,
+) (vec *payload.Object_Vector, err error) {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.ObjectRPCServiceName+"/"+vald.GetObjectRPCName), apiName+"/"+vald.GetObjectRPCName)
defer func() {
if span != nil {
@@ -3092,7 +3158,7 @@ func (s *server) GetObject(ctx context.Context, req *payload.Object_VectorReques
}
}()
- _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (interface{}, error) {
+ _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc service.MirrorClient, copts ...grpc.CallOption) (any, error) {
vec, err = vc.GetObject(ctx, req, copts...)
return vec, err
})
@@ -3199,7 +3265,9 @@ func (s *server) StreamGetObject(stream vald.Object_StreamGetObjectServer) (err
}
// StreamListObject bypasses it as a StreamListObject request to the Vald gateway (LB gateway) in its own cluster.
-func (s *server) StreamListObject(req *payload.Object_List_Request, stream vald.Object_StreamListObjectServer) error {
+func (s *server) StreamListObject(
+ req *payload.Object_List_Request, stream vald.Object_StreamListObjectServer,
+) error {
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(stream.Context(), vald.PackageName+"."+vald.ObjectRPCServiceName+"/"+vald.StreamListObjectRPCName), apiName+"/"+vald.StreamListObjectRPCName)
defer func() {
if span != nil {
@@ -3207,7 +3275,7 @@ func (s *server) StreamListObject(req *payload.Object_List_Request, stream vald.
}
}()
- _, err := s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, target string, vc service.MirrorClient, copts ...grpc.CallOption) (obj interface{}, err error) {
+ _, err := s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, target string, vc service.MirrorClient, copts ...grpc.CallOption) (obj any, err error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "Do/"+target), apiName+"/"+vald.StreamListObjectRPCName+"/"+target)
defer func() {
if span != nil {
@@ -3232,7 +3300,11 @@ func (s *server) StreamListObject(req *payload.Object_List_Request, stream vald.
return nil
}
-func (s *server) doStreamListObject(ctx context.Context, client vald.Object_StreamListObjectClient, server vald.Object_StreamListObjectServer) (err error) { // skipcq: GO-R1005
+func (s *server) doStreamListObject(
+ ctx context.Context,
+ client vald.Object_StreamListObjectClient,
+ server vald.Object_StreamListObjectServer,
+) (err error) { // skipcq: GO-R1005
cctx, cancel := context.WithCancel(ctx)
defer cancel()
eg, egctx := errgroup.WithContext(cctx)
@@ -3341,8 +3413,10 @@ func (s *server) doStreamListObject(ctx context.Context, client vald.Object_Stre
}
}
-// TODO: implement Flush handler
-func (s *server) Flush(ctx context.Context, req *payload.Flush_Request) (*payload.Info_Index_Count, error) {
+// TODO: implement Flush handler.
+func (s *server) Flush(
+ ctx context.Context, req *payload.Flush_Request,
+) (*payload.Info_Index_Count, error) {
return s.UnimplementedFlushServer.Flush(ctx, req)
}
diff --git a/pkg/gateway/mirror/handler/grpc/mock_test.go b/pkg/gateway/mirror/handler/grpc/mock_test.go
index 59ab5564a4..cc14471d7f 100644
--- a/pkg/gateway/mirror/handler/grpc/mock_test.go
+++ b/pkg/gateway/mirror/handler/grpc/mock_test.go
@@ -40,13 +40,16 @@ func (gm *gatewayMock) FromForwardedContext(ctx context.Context) string {
return gm.FromForwardedContextFunc(ctx)
}
-func (gm *gatewayMock) BroadCast(ctx context.Context,
+func (gm *gatewayMock) BroadCast(
+ ctx context.Context,
f func(ctx context.Context, target string, vc service.MirrorClient, copts ...grpc.CallOption) error,
) error {
return gm.BroadCastFunc(ctx, f)
}
-func (gm *gatewayMock) DoMulti(ctx context.Context, targets []string,
+func (gm *gatewayMock) DoMulti(
+ ctx context.Context,
+ targets []string,
f func(ctx context.Context, target string, vc service.MirrorClient, copts ...grpc.CallOption) error,
) error {
return gm.DoMultiFunc(ctx, targets, f)
diff --git a/pkg/gateway/mirror/handler/rest/handler.go b/pkg/gateway/mirror/handler/rest/handler.go
index 105cd3ec6f..777938a4ee 100644
--- a/pkg/gateway/mirror/handler/rest/handler.go
+++ b/pkg/gateway/mirror/handler/rest/handler.go
@@ -67,7 +67,7 @@ func New(opts ...Option) Handler {
// The response is written to the http.ResponseWriter.
func (h *handler) Register(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Mirror_Targets
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.Register(r.Context(), req)
})
}
@@ -76,8 +76,8 @@ func (h *handler) Register(w http.ResponseWriter, r *http.Request) (code int, er
// It returns an HTTP status code and an error. It creates a map to store data,
// then uses json.Handler to process the request, extract data, and log the request using dump.Request.
func (*handler) Index(w http.ResponseWriter, r *http.Request) (int, error) {
- data := make(map[string]interface{})
- return json.Handler(w, r, &data, func() (interface{}, error) {
+ data := make(map[string]any)
+ return json.Handler(w, r, &data, func() (any, error) {
return dump.Request(nil, data, r)
})
}
@@ -87,7 +87,7 @@ func (*handler) Index(w http.ResponseWriter, r *http.Request) (int, error) {
// then invokes the vald.Search method to handle the search logic.
func (h *handler) Search(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.Search(r.Context(), req)
})
}
@@ -97,7 +97,7 @@ func (h *handler) Search(w http.ResponseWriter, r *http.Request) (code int, err
// then invokes the vald.SearchByID method to handle the search by ID logic.
func (h *handler) SearchByID(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_IDRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.SearchByID(r.Context(), req)
})
}
@@ -107,7 +107,7 @@ func (h *handler) SearchByID(w http.ResponseWriter, r *http.Request) (code int,
// then invokes the vald.MultiSearch method to handle the multi-search logic.
func (h *handler) MultiSearch(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_MultiRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.MultiSearch(r.Context(), req)
})
}
@@ -117,7 +117,7 @@ func (h *handler) MultiSearch(w http.ResponseWriter, r *http.Request) (code int,
// then invokes the vald.MultiSearchByID method to handle the multi-search by ID logic.
func (h *handler) MultiSearchByID(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_MultiIDRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.MultiSearchByID(r.Context(), req)
})
}
@@ -127,7 +127,7 @@ func (h *handler) MultiSearchByID(w http.ResponseWriter, r *http.Request) (code
// then invokes the vald.LinearSearch method to handle the linear search logic.
func (h *handler) LinearSearch(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.LinearSearch(r.Context(), req)
})
}
@@ -137,7 +137,7 @@ func (h *handler) LinearSearch(w http.ResponseWriter, r *http.Request) (code int
// then invokes the vald.LinearSearchByID method to handle the linear search by ID logic.
func (h *handler) LinearSearchByID(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_IDRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.LinearSearchByID(r.Context(), req)
})
}
@@ -147,7 +147,7 @@ func (h *handler) LinearSearchByID(w http.ResponseWriter, r *http.Request) (code
// then invokes the vald.MultiLinearSearch method to handle the multi-linear search logic.
func (h *handler) MultiLinearSearch(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Search_MultiRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.MultiLinearSearch(r.Context(), req)
})
}
@@ -155,9 +155,11 @@ func (h *handler) MultiLinearSearch(w http.ResponseWriter, r *http.Request) (cod
// MultiLinearSearchByID is an HTTP handler function that processes multi-linear search by ID requests.
// It decodes the incoming JSON payload into a payload.Search_MultiIDRequest struct,
// then invokes the vald.MultiLinearSearchByID method to handle the multi-linear search by ID logic.
-func (h *handler) MultiLinearSearchByID(w http.ResponseWriter, r *http.Request) (code int, err error) {
+func (h *handler) MultiLinearSearchByID(
+ w http.ResponseWriter, r *http.Request,
+) (code int, err error) {
var req *payload.Search_MultiIDRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.MultiLinearSearchByID(r.Context(), req)
})
}
@@ -167,7 +169,7 @@ func (h *handler) MultiLinearSearchByID(w http.ResponseWriter, r *http.Request)
// then invokes the vald.Insert method to handle the insert logic.
func (h *handler) Insert(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Insert_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.Insert(r.Context(), req)
})
}
@@ -177,7 +179,7 @@ func (h *handler) Insert(w http.ResponseWriter, r *http.Request) (code int, err
// then invokes the vald.MultiInsert method to handle the multi-insert logic.
func (h *handler) MultiInsert(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Insert_MultiRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.MultiInsert(r.Context(), req)
})
}
@@ -187,7 +189,7 @@ func (h *handler) MultiInsert(w http.ResponseWriter, r *http.Request) (code int,
// then invokes the vald.Update method to handle the update logic.
func (h *handler) Update(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Update_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.Update(r.Context(), req)
})
}
@@ -197,7 +199,7 @@ func (h *handler) Update(w http.ResponseWriter, r *http.Request) (code int, err
// then invokes the vald.MultiUpdate method to handle the multi-update logic.
func (h *handler) MultiUpdate(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Update_MultiRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.MultiUpdate(r.Context(), req)
})
}
@@ -207,7 +209,7 @@ func (h *handler) MultiUpdate(w http.ResponseWriter, r *http.Request) (code int,
// then invokes the vald.Upsert method to handle the upsert logic.
func (h *handler) Upsert(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Upsert_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.Upsert(r.Context(), req)
})
}
@@ -217,7 +219,7 @@ func (h *handler) Upsert(w http.ResponseWriter, r *http.Request) (code int, err
// then invokes the vald.MultiUpsert method to handle the multi-upsert logic.
func (h *handler) MultiUpsert(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Upsert_MultiRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.MultiUpsert(r.Context(), req)
})
}
@@ -227,7 +229,7 @@ func (h *handler) MultiUpsert(w http.ResponseWriter, r *http.Request) (code int,
// then invokes the vald.Remove method to handle the remove logic.
func (h *handler) Remove(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Remove_Request
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.Remove(r.Context(), req)
})
}
@@ -237,7 +239,7 @@ func (h *handler) Remove(w http.ResponseWriter, r *http.Request) (code int, err
// then invokes the vald.RemoveByTimestamp method to handle the remove-by-timestamp logic.
func (h *handler) RemoveByTimestamp(w http.ResponseWriter, r *http.Request) (int, error) {
var req *payload.Remove_TimestampRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.RemoveByTimestamp(r.Context(), req)
})
}
@@ -247,7 +249,7 @@ func (h *handler) RemoveByTimestamp(w http.ResponseWriter, r *http.Request) (int
// then invokes the vald.MultiRemove method to handle the multi-remove logic.
func (h *handler) MultiRemove(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Remove_MultiRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.MultiRemove(r.Context(), req)
})
}
@@ -257,7 +259,7 @@ func (h *handler) MultiRemove(w http.ResponseWriter, r *http.Request) (code int,
// then invokes the vald.GetObject method to handle the get-object logic.
func (h *handler) GetObject(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Object_VectorRequest
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.GetObject(r.Context(), req)
})
}
@@ -267,7 +269,7 @@ func (h *handler) GetObject(w http.ResponseWriter, r *http.Request) (code int, e
// then invokes the vald.Exists method to handle the exists logic.
func (h *handler) Exists(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Object_ID
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.vald.Exists(r.Context(), req)
})
}
diff --git a/pkg/gateway/mirror/router/option.go b/pkg/gateway/mirror/router/option.go
index 7b3e7d1782..ce38a5e3b3 100644
--- a/pkg/gateway/mirror/router/option.go
+++ b/pkg/gateway/mirror/router/option.go
@@ -13,9 +13,7 @@
// limitations under the License.
package router
-import (
- "github.com/vdaas/vald/pkg/gateway/mirror/handler/rest"
-)
+import "github.com/vdaas/vald/pkg/gateway/mirror/handler/rest"
type Option func(*router)
diff --git a/pkg/gateway/mirror/service/discovery.go b/pkg/gateway/mirror/service/discovery.go
index c5e41ad8fe..43c2929d30 100644
--- a/pkg/gateway/mirror/service/discovery.go
+++ b/pkg/gateway/mirror/service/discovery.go
@@ -171,7 +171,9 @@ type deletedTarget struct {
port uint32
}
-func (d *discovery) startSync(ctx context.Context, prev map[string]target.Target) (current map[string]target.Target, errs error) {
+func (d *discovery) startSync(
+ ctx context.Context, prev map[string]target.Target,
+) (current map[string]target.Target, errs error) {
current = d.loadTargets()
curAddrs := map[string]string{} // map[addr: metadata.name]
@@ -222,7 +224,9 @@ func (d *discovery) startSync(ctx context.Context, prev map[string]target.Target
return current, d.syncWithAddr(ctx, current, curAddrs)
}
-func (d *discovery) syncWithAddr(ctx context.Context, current map[string]target.Target, curAddrs map[string]string) (errs error) {
+func (d *discovery) syncWithAddr(
+ ctx context.Context, current map[string]target.Target, curAddrs map[string]string,
+) (errs error) {
for addr, name := range curAddrs {
// When the status code of a regularly running Register RPC is Unimplemented, the connection to the target will be disconnected
// so the status of the resource (CR) may be misaligned. To prevent this, change the status of the resource to Disconnected.
@@ -276,7 +280,9 @@ func (d *discovery) connectTarget(ctx context.Context, req map[string]*createdTa
return errs
}
-func (d *discovery) createMirrorTargetResource(ctx context.Context, name, host string, port int) error {
+func (d *discovery) createMirrorTargetResource(
+ ctx context.Context, name, host string, port int,
+) error {
mt, err := target.NewMirrorTargetTemplate(
target.WithMirrorTargetName(name),
target.WithMirrorTargetNamespace(d.namespace),
@@ -294,7 +300,9 @@ func (d *discovery) createMirrorTargetResource(ctx context.Context, name, host s
return d.ctrl.GetManager().GetClient().Create(ctx, mt)
}
-func (d *discovery) disconnectTarget(ctx context.Context, req map[string]*deletedTarget) (errs error) {
+func (d *discovery) disconnectTarget(
+ ctx context.Context, req map[string]*deletedTarget,
+) (errs error) {
for _, deleted := range req {
phase := target.MirrorTargetPhaseDisconnected
err := d.mirr.Disconnect(ctx, &payload.Mirror_Target{
@@ -310,7 +318,9 @@ func (d *discovery) disconnectTarget(ctx context.Context, req map[string]*delete
return errs
}
-func (d *discovery) updateMirrorTargetPhase(ctx context.Context, name string, phase target.MirrorTargetPhase) error {
+func (d *discovery) updateMirrorTargetPhase(
+ ctx context.Context, name string, phase target.MirrorTargetPhase,
+) error {
c := d.ctrl.GetManager().GetClient()
mt := &target.MirrorTarget{}
err := c.Get(ctx, k8s.ObjectKey{
diff --git a/pkg/gateway/mirror/service/gateway.go b/pkg/gateway/mirror/service/gateway.go
index d2a8b9dbd8..674f7b93aa 100644
--- a/pkg/gateway/mirror/service/gateway.go
+++ b/pkg/gateway/mirror/service/gateway.go
@@ -37,7 +37,7 @@ type Gateway interface {
BroadCast(ctx context.Context,
f func(ctx context.Context, target string, vc MirrorClient, copts ...grpc.CallOption) error) error
Do(ctx context.Context, target string,
- f func(ctx context.Context, target string, vc MirrorClient, copts ...grpc.CallOption) (interface{}, error)) (interface{}, error)
+ f func(ctx context.Context, target string, vc MirrorClient, copts ...grpc.CallOption) (any, error)) (any, error)
DoMulti(ctx context.Context, targets []string,
f func(ctx context.Context, target string, vc MirrorClient, copts ...grpc.CallOption) error) error
GRPCClient() grpc.Client
@@ -103,7 +103,8 @@ func (*gateway) FromForwardedContext(ctx context.Context) string {
// BroadCast performs a broadcast operation using the provided function
// to interact with gRPC clients for multiple targets.
// The provided function should handle the communication logic for a target.
-func (g *gateway) BroadCast(ctx context.Context,
+func (g *gateway) BroadCast(
+ ctx context.Context,
f func(ctx context.Context, target string, vc MirrorClient, copts ...grpc.CallOption) error,
) (err error) {
ctx, span := trace.StartSpan(ctx, "vald/gateway/mirror/service/Gateway.BroadCast")
@@ -127,9 +128,11 @@ func (g *gateway) BroadCast(ctx context.Context,
// Do performs a gRPC operation on a single target using the provided function.
// It returns the result of the operation and any associated error.
// The provided function should handle the communication logic for a target.
-func (g *gateway) Do(ctx context.Context, target string,
- f func(ctx context.Context, addr string, vc MirrorClient, copts ...grpc.CallOption) (interface{}, error),
-) (res interface{}, err error) {
+func (g *gateway) Do(
+ ctx context.Context,
+ target string,
+ f func(ctx context.Context, addr string, vc MirrorClient, copts ...grpc.CallOption) (any, error),
+) (res any, err error) {
ctx, span := trace.StartSpan(ctx, "vald/gateway/mirror/service/Gateway.Do")
defer func() {
if span != nil {
@@ -141,7 +144,7 @@ func (g *gateway) Do(ctx context.Context, target string,
return nil, errors.ErrTargetNotFound
}
return g.client.GRPCClient().Do(g.ForwardedContext(ctx, g.podName), target,
- func(ictx context.Context, conn *grpc.ClientConn, copts ...grpc.CallOption) (interface{}, error) {
+ func(ictx context.Context, conn *grpc.ClientConn, copts ...grpc.CallOption) (any, error) {
return f(ictx, target, NewMirrorClient(conn), copts...)
},
)
@@ -150,7 +153,9 @@ func (g *gateway) Do(ctx context.Context, target string,
// DoMulti performs a gRPC operation on multiple targets using the provided function.
// It returns an error if any of the operations fails.
// The provided function should handle the communication logic for a target.
-func (g *gateway) DoMulti(ctx context.Context, targets []string,
+func (g *gateway) DoMulti(
+ ctx context.Context,
+ targets []string,
f func(ctx context.Context, target string, vc MirrorClient, copts ...grpc.CallOption) error,
) error {
ctx, span := trace.StartSpan(ctx, "vald/gateway/mirror/service/Gateway.DoMulti")
diff --git a/pkg/gateway/mirror/service/gateway_mock_test.go b/pkg/gateway/mirror/service/gateway_mock_test.go
index baaed0ae4c..d0c8c924f9 100644
--- a/pkg/gateway/mirror/service/gateway_mock_test.go
+++ b/pkg/gateway/mirror/service/gateway_mock_test.go
@@ -27,7 +27,7 @@ type GatewayMock struct {
BroadCastFunc func(ctx context.Context,
f func(ctx context.Context, target string, vc MirrorClient, copts ...grpc.CallOption) error) error
DoFunc func(ctx context.Context, target string,
- f func(ctx context.Context, target string, vc MirrorClient, copts ...grpc.CallOption) (interface{}, error)) (interface{}, error)
+ f func(ctx context.Context, target string, vc MirrorClient, copts ...grpc.CallOption) (any, error)) (any, error)
DoMultiFunc func(ctx context.Context, targets []string,
f func(ctx context.Context, target string, vc MirrorClient, copts ...grpc.CallOption) error) error
GRPCClientFunc func() grpc.Client
@@ -44,21 +44,26 @@ func (gm *GatewayMock) FromForwardedContext(ctx context.Context) string {
}
// BroadCast calls BroadCastFunc object.
-func (gm *GatewayMock) BroadCast(ctx context.Context,
+func (gm *GatewayMock) BroadCast(
+ ctx context.Context,
f func(_ context.Context, _ string, _ MirrorClient, _ ...grpc.CallOption) error,
) error {
return gm.BroadCastFunc(ctx, f)
}
// Do calls DoFunc object.
-func (gm *GatewayMock) Do(ctx context.Context, target string,
- f func(_ context.Context, _ string, _ MirrorClient, _ ...grpc.CallOption) (interface{}, error),
-) (interface{}, error) {
+func (gm *GatewayMock) Do(
+ ctx context.Context,
+ target string,
+ f func(_ context.Context, _ string, _ MirrorClient, _ ...grpc.CallOption) (any, error),
+) (any, error) {
return gm.DoFunc(ctx, target, f)
}
// DoMulti calls DoMultiFunc object.
-func (gm *GatewayMock) DoMulti(ctx context.Context, targets []string,
+func (gm *GatewayMock) DoMulti(
+ ctx context.Context,
+ targets []string,
f func(_ context.Context, _ string, _ MirrorClient, _ ...grpc.CallOption) error,
) error {
return gm.DoMultiFunc(ctx, targets, f)
diff --git a/pkg/gateway/mirror/service/mirror.go b/pkg/gateway/mirror/service/mirror.go
index c23eb8d510..b5ab31609b 100644
--- a/pkg/gateway/mirror/service/mirror.go
+++ b/pkg/gateway/mirror/service/mirror.go
@@ -168,7 +168,9 @@ func (m *mirr) Start(ctx context.Context) <-chan error { // skipcq: GO-R1005
return ech
}
-func (m *mirr) registers(ctx context.Context, tgts *payload.Mirror_Targets) ([]*payload.Mirror_Target, error) { // skipcq: GO-R1005
+func (m *mirr) registers(
+ ctx context.Context, tgts *payload.Mirror_Targets,
+) ([]*payload.Mirror_Target, error) { // skipcq: GO-R1005
ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+mirror.RPCServiceName+"/"+mirror.RegisterRPCName), "vald/gateway/mirror/service/Mirror.registers")
defer func() {
if span != nil {
diff --git a/pkg/index/job/correction/service/corrector.go b/pkg/index/job/correction/service/corrector.go
index 0ea917a8fb..073bf39e02 100644
--- a/pkg/index/job/correction/service/corrector.go
+++ b/pkg/index/job/correction/service/corrector.go
@@ -24,7 +24,6 @@ import (
"sync/atomic"
"time"
- agent "github.com/vdaas/vald/apis/grpc/v1/agent/core"
"github.com/vdaas/vald/apis/grpc/v1/payload"
"github.com/vdaas/vald/apis/grpc/v1/vald"
"github.com/vdaas/vald/internal/client/v1/client/discoverer"
@@ -306,7 +305,9 @@ type vectorReplica struct {
}
// Validate len(addrs) >= 2 before calling this function.
-func (c *correct) checkConsistency(ctx context.Context, targetReplica *vectorReplica, targetAgentIdx int) error {
+func (c *correct) checkConsistency(
+ ctx context.Context, targetReplica *vectorReplica, targetAgentIdx int,
+) error {
// leftAgentAddrs is the agents' addr that hasn't been corrected yet.
leftAgentAddrs := c.sortedByIndexCntAddrs[targetAgentIdx+1:]
@@ -321,7 +322,7 @@ func (c *correct) checkConsistency(ctx context.Context, targetReplica *vectorRep
var mu sync.Mutex
if err := c.discoverer.GetClient().OrderedRangeConcurrent(ctx, leftAgentAddrs, len(leftAgentAddrs),
func(ctx context.Context, addr string, conn *grpc.ClientConn, copts ...grpc.CallOption) error {
- vecMeta, err := agent.NewAgentClient(conn).GetTimestamp(ctx, &payload.Object_GetTimestampRequest{
+ vecMeta, err := vald.NewValdClient(conn).GetTimestamp(ctx, &payload.Object_TimestampRequest{
Id: &payload.Object_ID{
Id: targetReplica.vec.GetId(),
},
@@ -379,7 +380,9 @@ func (c *correct) checkConsistency(ctx context.Context, targetReplica *vectorRep
return nil
}
-func (c *correct) correctTimestamp(ctx context.Context, targetReplica *vectorReplica, foundReplicas []*vectorReplica) error {
+func (c *correct) correctTimestamp(
+ ctx context.Context, targetReplica *vectorReplica, foundReplicas []*vectorReplica,
+) error {
if len(foundReplicas) == 0 {
// no replica found. nothing to do about timestamp
return nil
@@ -421,9 +424,7 @@ func (c *correct) correctTimestamp(ctx context.Context, targetReplica *vectorRep
// correctReplica corrects the number of replicas of the target vector.
// skipcq: GO-R1005
func (c *correct) correctReplica(
- ctx context.Context,
- targetReplica *vectorReplica,
- foundReplicas []*vectorReplica,
+ ctx context.Context, targetReplica *vectorReplica, foundReplicas []*vectorReplica,
) error {
// diff < 0 means there is less replica than the correct number
existReplica := len(foundReplicas) + 1
@@ -514,7 +515,7 @@ func (c *correct) updateObject(ctx context.Context, dest, src *vectorReplica) er
}
res, err := c.discoverer.GetClient().
- Do(grpc.WithGRPCMethod(ctx, updateMethod), dest.addr, func(ctx context.Context, conn *grpc.ClientConn, copts ...grpc.CallOption) (interface{}, error) {
+ Do(grpc.WithGRPCMethod(ctx, updateMethod), dest.addr, func(ctx context.Context, conn *grpc.ClientConn, copts ...grpc.CallOption) (any, error) {
// TODO: use UpdateTimestamp when it's implemented because here we just want to update only the timestamp but not the vector
return vald.NewUpdateClient(conn).Update(ctx, &payload.Update_Request{
Vector: src.vec,
@@ -540,7 +541,7 @@ func (c *correct) updateObject(ctx context.Context, dest, src *vectorReplica) er
func (c *correct) fillVectorField(ctx context.Context, replica *vectorReplica) error {
res, err := c.discoverer.GetClient().
- Do(grpc.WithGRPCMethod(ctx, "core.v1.Vald/GetObject"), replica.addr, func(ctx context.Context, conn *grpc.ClientConn, copts ...grpc.CallOption) (interface{}, error) {
+ Do(grpc.WithGRPCMethod(ctx, "core.v1.Vald/GetObject"), replica.addr, func(ctx context.Context, conn *grpc.ClientConn, copts ...grpc.CallOption) (any, error) {
return vald.NewValdClient(conn).GetObject(ctx, &payload.Object_VectorRequest{
Id: &payload.Object_ID{
Id: replica.vec.GetId(),
@@ -562,9 +563,11 @@ func (c *correct) fillVectorField(ctx context.Context, replica *vectorReplica) e
return nil
}
-func (c *correct) insertObject(ctx context.Context, addr string, vector *payload.Object_Vector) error {
+func (c *correct) insertObject(
+ ctx context.Context, addr string, vector *payload.Object_Vector,
+) error {
res, err := c.discoverer.GetClient().
- Do(grpc.WithGRPCMethod(ctx, insertMethod), addr, func(ctx context.Context, conn *grpc.ClientConn, copts ...grpc.CallOption) (interface{}, error) {
+ Do(grpc.WithGRPCMethod(ctx, insertMethod), addr, func(ctx context.Context, conn *grpc.ClientConn, copts ...grpc.CallOption) (any, error) {
return vald.NewInsertClient(conn).Insert(ctx, &payload.Insert_Request{
Vector: vector,
// TODO: this should be deleted after Config.Timestamp deprecation
@@ -584,9 +587,11 @@ func (c *correct) insertObject(ctx context.Context, addr string, vector *payload
return nil
}
-func (c *correct) deleteObject(ctx context.Context, addr string, vector *payload.Object_Vector) error {
+func (c *correct) deleteObject(
+ ctx context.Context, addr string, vector *payload.Object_Vector,
+) error {
res, err := c.discoverer.GetClient().
- Do(grpc.WithGRPCMethod(ctx, deleteMethod), addr, func(ctx context.Context, conn *grpc.ClientConn, copts ...grpc.CallOption) (interface{}, error) {
+ Do(grpc.WithGRPCMethod(ctx, deleteMethod), addr, func(ctx context.Context, conn *grpc.ClientConn, copts ...grpc.CallOption) (any, error) {
return vald.NewRemoveClient(conn).Remove(ctx, &payload.Remove_Request{
Id: &payload.Object_ID{
Id: vector.GetId(),
@@ -619,7 +624,7 @@ func (c *correct) loadAgentIndexInfo(ctx context.Context) (err error) {
case <-ctx.Done():
return nil
default:
- info, err := agent.NewAgentClient(conn).IndexInfo(ctx, new(payload.Empty), copts...)
+ info, err := vald.NewValdClient(conn).IndexInfo(ctx, new(payload.Empty), copts...)
if err != nil {
log.Warnf("an error occurred while calling IndexInfo of %s: %s", addr, err)
return nil
diff --git a/pkg/index/job/correction/service/options.go b/pkg/index/job/correction/service/options.go
index f8350eef97..3913271e6b 100644
--- a/pkg/index/job/correction/service/options.go
+++ b/pkg/index/job/correction/service/options.go
@@ -22,10 +22,8 @@ import (
type Option func(*correct) error
var defaultOpts = []Option{
- //nolint:gomnd
- WithStreamListConcurrency(200),
- //nolint:gomnd
- WithKvsAsyncWriteConcurrency(2048),
+ WithStreamListConcurrency(200), //nolint:gomnd
+ WithKvsAsyncWriteConcurrency(2048), //nolint:gomnd
}
// WithIndexReplica returns Option that sets index replica.
diff --git a/pkg/index/job/creation/service/indexer.go b/pkg/index/job/creation/service/indexer.go
index 83ac1eb4e8..87a0159116 100644
--- a/pkg/index/job/creation/service/indexer.go
+++ b/pkg/index/job/creation/service/indexer.go
@@ -136,7 +136,10 @@ func (idx *index) Start(ctx context.Context) error {
}
// skipcq: GO-R1005
-func (idx *index) doCreateIndex(ctx context.Context, fn func(_ context.Context, _ agent.AgentClient, _ ...grpc.CallOption) (*payload.Empty, error)) (errs error) {
+func (idx *index) doCreateIndex(
+ ctx context.Context,
+ fn func(_ context.Context, _ agent.AgentClient, _ ...grpc.CallOption) (*payload.Empty, error),
+) (errs error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, grpcMethodName), apiName+"/service/index.doCreateIndex")
defer func() {
if span != nil {
diff --git a/pkg/index/job/readreplica/rotate/service/rotator.go b/pkg/index/job/readreplica/rotate/service/rotator.go
index e3c8bfec6b..9975e31b1a 100644
--- a/pkg/index/job/readreplica/rotate/service/rotator.go
+++ b/pkg/index/job/readreplica/rotate/service/rotator.go
@@ -183,7 +183,9 @@ func (s *subProcess) rotate(ctx context.Context) error {
return nil
}
-func (s *subProcess) createSnapshot(ctx context.Context, deployment *k8s.Deployment) (newSnap, oldSnap *k8s.VolumeSnapshot, err error) {
+func (s *subProcess) createSnapshot(
+ ctx context.Context, deployment *k8s.Deployment,
+) (newSnap, oldSnap *k8s.VolumeSnapshot, err error) {
list := k8s.VolumeSnapshotList{}
if err := s.client.List(ctx, &list, &s.listOpts); err != nil {
return nil, nil, fmt.Errorf("failed to get snapshot: %w", err)
@@ -227,7 +229,9 @@ func (s *subProcess) createSnapshot(ctx context.Context, deployment *k8s.Deploym
return newSnap, oldSnap, nil
}
-func (s *subProcess) createPVC(ctx context.Context, newSnapShot string, deployment *k8s.Deployment) (newPvc, oldPvc *k8s.PersistentVolumeClaim, err error) {
+func (s *subProcess) createPVC(
+ ctx context.Context, newSnapShot string, deployment *k8s.Deployment,
+) (newPvc, oldPvc *k8s.PersistentVolumeClaim, err error) {
list := k8s.PersistentVolumeClaimList{}
if err := s.client.List(ctx, &list, &s.listOpts); err != nil {
return nil, nil, fmt.Errorf("failed to get PVC: %w", err)
@@ -293,7 +297,9 @@ func (s *subProcess) getDeployment(ctx context.Context) (*k8s.Deployment, error)
return &list.Items[0], nil
}
-func (s *subProcess) updateDeployment(ctx context.Context, newPVC string, deployment *k8s.Deployment, snapshotTime time.Time) error {
+func (s *subProcess) updateDeployment(
+ ctx context.Context, newPVC string, deployment *k8s.Deployment, snapshotTime time.Time,
+) error {
if deployment.Spec.Template.ObjectMeta.Annotations == nil {
deployment.Spec.Template.ObjectMeta.Annotations = map[string]string{}
}
diff --git a/pkg/index/job/save/service/indexer.go b/pkg/index/job/save/service/indexer.go
index a3e8325ba4..192caa0fb5 100644
--- a/pkg/index/job/save/service/indexer.go
+++ b/pkg/index/job/save/service/indexer.go
@@ -133,7 +133,10 @@ func (idx *index) Start(ctx context.Context) error {
}
// skipcq: GO-R1005
-func (idx *index) doSaveIndex(ctx context.Context, fn func(_ context.Context, _ agent.AgentClient, _ ...grpc.CallOption) (*payload.Empty, error)) (errs error) {
+func (idx *index) doSaveIndex(
+ ctx context.Context,
+ fn func(_ context.Context, _ agent.AgentClient, _ ...grpc.CallOption) (*payload.Empty, error),
+) (errs error) {
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, grpcMethodName), apiName+"/service/index.doSaveIndex")
defer func() {
if span != nil {
diff --git a/pkg/index/operator/service/operator.go b/pkg/index/operator/service/operator.go
index 9f7c7b1c48..dc9f476958 100644
--- a/pkg/index/operator/service/operator.go
+++ b/pkg/index/operator/service/operator.go
@@ -62,7 +62,11 @@ type operator struct {
}
// New returns Indexer object if no error occurs.
-func New(namespace, agentName, rotatorName, targetReadReplicaIDKey string, rotatorJob *k8s.Job, opts ...Option) (o Operator, err error) {
+func New(
+ namespace, agentName, rotatorName, targetReadReplicaIDKey string,
+ rotatorJob *k8s.Job,
+ opts ...Option,
+) (o Operator, err error) {
operator := new(operator)
operator.namespace = namespace
operator.targetReadReplicaIDAnnotationsKey = targetReadReplicaIDKey
@@ -168,7 +172,9 @@ func (o *operator) podOnReconcile(ctx context.Context, pod *k8s.Pod) (k8s.Result
// reconcileRotatorJob starts rotation job when the condition meets.
// This function is work in progress.
-func (o *operator) reconcileRotatorJob(ctx context.Context, pod *k8s.Pod) (requeue bool, err error) {
+func (o *operator) reconcileRotatorJob(
+ ctx context.Context, pod *k8s.Pod,
+) (requeue bool, err error) {
podIdx, ok := pod.Labels[k8s.PodIndexLabel]
if !ok {
log.Info("no index label found. the agent is not StatefulSet? skipping...")
@@ -236,7 +242,9 @@ func needsRotation(agentAnnotations, readReplicaAnnotations map[string]string) (
return true, nil
}
-func (o *operator) createRotationJobOrRequeue(ctx context.Context, podIdx string) (rq bool, err error) {
+func (o *operator) createRotationJobOrRequeue(
+ ctx context.Context, podIdx string,
+) (rq bool, err error) {
// get all the rotation jobs and make sure the job is not running
res, err := o.ensureJobConcurrency(ctx, podIdx)
if err != nil {
@@ -275,7 +283,9 @@ func (o *operator) createRotationJobOrRequeue(ctx context.Context, podIdx string
// ensureJobConcurrency controls the job concurrency. It cannot handle concurrent calls but it is fine because
// the MaxConcurrentReconciles defaults to 1 and we do not change it.
-func (o *operator) ensureJobConcurrency(ctx context.Context, podIdx string) (jobReconcileResult, error) {
+func (o *operator) ensureJobConcurrency(
+ ctx context.Context, podIdx string,
+) (jobReconcileResult, error) {
// get all the rotation jobs and make sure the job is not running
var jobList k8s.JobList
selector, err := o.client.LabelSelector("app", k8s.SelectionOpEquals, []string{o.rotatorName})
diff --git a/pkg/index/operator/usecase/operator.go b/pkg/index/operator/usecase/operator.go
index c2e0e71aa1..323db08081 100644
--- a/pkg/index/operator/usecase/operator.go
+++ b/pkg/index/operator/usecase/operator.go
@@ -100,7 +100,7 @@ func (r *run) PreStart(ctx context.Context) error {
// Start is a method used to initiate an operation in the run, and it returns a channel for receiving errors
// during the operation and an error representing any initialization errors.
func (r *run) Start(ctx context.Context) (<-chan error, error) {
- ech := make(chan error, 3) //nolint: gomnd
+ ech := make(chan error, 3) //nolint:gomnd
var oech, dech, sech <-chan error
r.eg.Go(safety.RecoverFunc(func() (err error) {
defer close(ech)
diff --git a/pkg/manager/index/handler/grpc/handler.go b/pkg/manager/index/handler/grpc/handler.go
index baa60334b2..b910f2742a 100644
--- a/pkg/manager/index/handler/grpc/handler.go
+++ b/pkg/manager/index/handler/grpc/handler.go
@@ -20,8 +20,8 @@ package grpc
import (
"context"
- "github.com/vdaas/vald/apis/grpc/v1/manager/index"
"github.com/vdaas/vald/apis/grpc/v1/payload"
+ index "github.com/vdaas/vald/apis/grpc/v1/vald"
"github.com/vdaas/vald/internal/observability/trace"
"github.com/vdaas/vald/pkg/manager/index/service"
)
@@ -40,7 +40,9 @@ func New(opts ...Option) index.IndexServer {
return s
}
-func (s *server) IndexInfo(ctx context.Context, _ *payload.Empty) (res *payload.Info_Index_Count, err error) {
+func (s *server) IndexInfo(
+ ctx context.Context, _ *payload.Empty,
+) (res *payload.Info_Index_Count, err error) {
ctx, span := trace.StartSpan(ctx, "vald/manager-index.IndexInfo")
defer func() {
if span != nil {
@@ -53,3 +55,15 @@ func (s *server) IndexInfo(ctx context.Context, _ *payload.Empty) (res *payload.
Indexing: s.indexer.IsIndexing(),
}, nil
}
+
+func (s *server) IndexDetail(
+ ctx context.Context, _ *payload.Empty,
+) (res *payload.Info_Index_Detail, err error) {
+ ctx, span := trace.StartSpan(ctx, "vald/manager-index.IndexDetail")
+ defer func() {
+ if span != nil {
+ span.End()
+ }
+ }()
+ return s.indexer.LoadIndexDetail(), nil
+}
diff --git a/pkg/manager/index/handler/grpc/handler_test.go b/pkg/manager/index/handler/grpc/handler_test.go
index 7318ce15fb..e937ff8a3a 100644
--- a/pkg/manager/index/handler/grpc/handler_test.go
+++ b/pkg/manager/index/handler/grpc/handler_test.go
@@ -214,3 +214,113 @@ package grpc
// })
// }
// }
+//
+// func Test_server_IndexDetail(t *testing.T) {
+// type args struct {
+// ctx context.Context
+// in1 *payload.Empty
+// }
+// type fields struct {
+// indexer service.Indexer
+// UnimplementedIndexServer index.UnimplementedIndexServer
+// }
+// type want struct {
+// wantRes *payload.Info_Index_Detail
+// err error
+// }
+// type test struct {
+// name string
+// args args
+// fields fields
+// want want
+// checkFunc func(want, *payload.Info_Index_Detail, error) error
+// beforeFunc func(*testing.T, args)
+// afterFunc func(*testing.T, args)
+// }
+// defaultCheckFunc := func(w want, gotRes *payload.Info_Index_Detail, err error) error {
+// if !errors.Is(err, w.err) {
+// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err)
+// }
+// if !reflect.DeepEqual(gotRes, w.wantRes) {
+// return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotRes, w.wantRes)
+// }
+// return nil
+// }
+// tests := []test{
+// // TODO test cases
+// /*
+// {
+// name: "test_case_1",
+// args: args {
+// ctx:nil,
+// in1:nil,
+// },
+// fields: fields {
+// indexer:nil,
+// UnimplementedIndexServer:nil,
+// },
+// want: want{},
+// checkFunc: defaultCheckFunc,
+// beforeFunc: func(t *testing.T, args args) {
+// t.Helper()
+// },
+// afterFunc: func(t *testing.T, args args) {
+// t.Helper()
+// },
+// },
+// */
+//
+// // TODO test cases
+// /*
+// func() test {
+// return test {
+// name: "test_case_2",
+// args: args {
+// ctx:nil,
+// in1:nil,
+// },
+// fields: fields {
+// indexer:nil,
+// UnimplementedIndexServer:nil,
+// },
+// want: want{},
+// checkFunc: defaultCheckFunc,
+// beforeFunc: func(t *testing.T, args args) {
+// t.Helper()
+// },
+// afterFunc: func(t *testing.T, args args) {
+// t.Helper()
+// },
+// }
+// }(),
+// */
+// }
+//
+// for _, tc := range tests {
+// test := tc
+// t.Run(test.name, func(tt *testing.T) {
+// tt.Parallel()
+// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent())
+// if test.beforeFunc != nil {
+// test.beforeFunc(tt, test.args)
+// }
+// if test.afterFunc != nil {
+// defer test.afterFunc(tt, test.args)
+// }
+// checkFunc := test.checkFunc
+// if test.checkFunc == nil {
+// checkFunc = defaultCheckFunc
+// }
+// s := &server{
+// indexer: test.fields.indexer,
+// UnimplementedIndexServer: test.fields.UnimplementedIndexServer,
+// }
+//
+// gotRes, err := s.IndexDetail(test.args.ctx, test.args.in1)
+// if err := checkFunc(test.want, gotRes, err); err != nil {
+// tt.Errorf("error = %v", err)
+// }
+//
+// })
+// }
+// }
diff --git a/pkg/manager/index/handler/grpc/option.go b/pkg/manager/index/handler/grpc/option.go
index 3323225bb6..d521b356ff 100644
--- a/pkg/manager/index/handler/grpc/option.go
+++ b/pkg/manager/index/handler/grpc/option.go
@@ -17,9 +17,7 @@
// Package grpc provides grpc server logic
package grpc
-import (
- "github.com/vdaas/vald/pkg/manager/index/service"
-)
+import "github.com/vdaas/vald/pkg/manager/index/service"
type Option func(*server)
diff --git a/pkg/manager/index/handler/rest/handler.go b/pkg/manager/index/handler/rest/handler.go
index 258d5d9c7d..c3e9d356f4 100644
--- a/pkg/manager/index/handler/rest/handler.go
+++ b/pkg/manager/index/handler/rest/handler.go
@@ -20,8 +20,8 @@ package rest
import (
"net/http"
- "github.com/vdaas/vald/apis/grpc/v1/manager/index"
"github.com/vdaas/vald/apis/grpc/v1/payload"
+ index "github.com/vdaas/vald/apis/grpc/v1/vald"
"github.com/vdaas/vald/internal/net/http/dump"
"github.com/vdaas/vald/internal/net/http/json"
)
@@ -45,15 +45,15 @@ func New(opts ...Option) Handler {
}
func (*handler) Index(w http.ResponseWriter, r *http.Request) (int, error) {
- data := make(map[string]interface{})
- return json.Handler(w, r, &data, func() (interface{}, error) {
+ data := make(map[string]any)
+ return json.Handler(w, r, &data, func() (any, error) {
return dump.Request(nil, data, r)
})
}
func (h *handler) IndexInfo(w http.ResponseWriter, r *http.Request) (code int, err error) {
var req *payload.Empty
- return json.Handler(w, r, &req, func() (interface{}, error) {
+ return json.Handler(w, r, &req, func() (any, error) {
return h.indexer.IndexInfo(r.Context(), req)
})
}
diff --git a/pkg/manager/index/handler/rest/option.go b/pkg/manager/index/handler/rest/option.go
index ec39e2913d..115765c052 100644
--- a/pkg/manager/index/handler/rest/option.go
+++ b/pkg/manager/index/handler/rest/option.go
@@ -17,7 +17,7 @@
// Package rest provides rest api logic
package rest
-import "github.com/vdaas/vald/apis/grpc/v1/manager/index"
+import index "github.com/vdaas/vald/apis/grpc/v1/vald"
type Option func(*handler)
diff --git a/pkg/manager/index/router/option.go b/pkg/manager/index/router/option.go
index 834aae2f68..b88a3b9b9b 100644
--- a/pkg/manager/index/router/option.go
+++ b/pkg/manager/index/router/option.go
@@ -17,9 +17,7 @@
// Package router provides implementation of Go API for routing http Handler wrapped by rest.Func
package router
-import (
- "github.com/vdaas/vald/pkg/manager/index/handler/rest"
-)
+import "github.com/vdaas/vald/pkg/manager/index/handler/rest"
type Option func(*router)
diff --git a/pkg/manager/index/service/indexer.go b/pkg/manager/index/service/indexer.go
index 4d6b39729b..42e90b1c9b 100644
--- a/pkg/manager/index/service/indexer.go
+++ b/pkg/manager/index/service/indexer.go
@@ -26,6 +26,7 @@ import (
agent "github.com/vdaas/vald/apis/grpc/v1/agent/core"
"github.com/vdaas/vald/apis/grpc/v1/payload"
+ vald "github.com/vdaas/vald/apis/grpc/v1/vald"
"github.com/vdaas/vald/internal/client/v1/client/discoverer"
"github.com/vdaas/vald/internal/errors"
"github.com/vdaas/vald/internal/log"
@@ -43,6 +44,8 @@ type Indexer interface {
NumberOfUUIDs() uint32
NumberOfUncommittedUUIDs() uint32
IsIndexing() bool
+ IsSaving() bool
+ LoadIndexDetail() *payload.Info_Index_Detail
}
type index struct {
@@ -51,18 +54,21 @@ type index struct {
creationPoolSize uint32
indexDuration time.Duration
indexDurationLimit time.Duration
+ saveIndexDuration time.Duration
saveIndexDurationLimit time.Duration
- saveIndexWaitDuration time.Duration
- saveIndexTargetAddrCh chan string
- schMap sync.Map[string, any]
- concurrency int
+ shouldSaveList sync.Map[string, struct{}]
+ createIndexConcurrency int
+ saveIndexConcurrency int
indexInfos sync.Map[string, *payload.Info_Index_Count]
- indexing atomic.Value // bool
+ indexing atomic.Bool
+ saving atomic.Bool
minUncommitted uint32
uuidsCount uint32
uncommittedUUIDsCount uint32
}
+var empty = struct{}{}
+
func New(opts ...Option) (idx Indexer, err error) {
i := new(index)
for _, opt := range append(defaultOptions, opts...) {
@@ -71,7 +77,8 @@ func New(opts ...Option) (idx Indexer, err error) {
}
}
i.indexing.Store(false)
- if i.indexDuration+i.indexDurationLimit+i.saveIndexDurationLimit == 0 {
+ i.saving.Store(false)
+ if i.indexDuration+i.indexDurationLimit+i.saveIndexDurationLimit <= 0 {
return nil, errors.ErrInvalidConfig
}
return i, nil
@@ -87,8 +94,6 @@ func (idx *index) Start(ctx context.Context) (<-chan error, error) {
return nil, err
}
ech := make(chan error, 100)
- sech := make(chan error, 10)
- idx.saveIndexTargetAddrCh = make(chan string, len(idx.client.GetAddrs(ctx))*2)
idx.eg.Go(safety.RecoverFunc(func() (err error) {
defer close(ech)
if idx.indexDuration <= 0 {
@@ -97,56 +102,101 @@ func (idx *index) Start(ctx context.Context) (<-chan error, error) {
if idx.indexDurationLimit <= 0 {
idx.indexDurationLimit = math.MaxInt64
}
+ if idx.saveIndexDuration <= 0 {
+ idx.saveIndexDuration = math.MaxInt64
+ }
if idx.saveIndexDurationLimit <= 0 {
idx.saveIndexDurationLimit = math.MaxInt64
}
it := time.NewTicker(idx.indexDuration)
itl := time.NewTicker(idx.indexDurationLimit)
+ st := time.NewTicker(idx.saveIndexDuration)
stl := time.NewTicker(idx.saveIndexDurationLimit)
defer it.Stop()
defer itl.Stop()
+ defer st.Stop()
defer stl.Stop()
finalize := func() (err error) {
err = ctx.Err()
- if err != nil && err != context.Canceled {
+ if err != nil &&
+ !errors.Is(err, context.Canceled) &&
+ !errors.Is(err, context.DeadlineExceeded) {
return err
}
return nil
}
+ var mu sync.Mutex
for {
select {
case <-ctx.Done():
return finalize()
case err = <-dech:
- ech <- err
- case err = <-sech:
- ech <- err
- case <-it.C:
- err = idx.execute(grpc.WithGRPCMethod(ctx, "core.v1.Agent/CreateIndex"), true, false)
- if err != nil {
- ech <- err
- log.Error("an error occurred during indexing", err)
- err = nil
+ case <-it.C: // index duration ticker
+ // execute CreateIndex. This execution ignores low index agent.
+ err = idx.createIndex(grpc.WithGRPCMethod(ctx, "core.v1.Agent/CreateIndex"), true)
+ if err != nil &&
+ !errors.Is(err, context.Canceled) &&
+ !errors.Is(err, context.DeadlineExceeded) {
+ err = errors.Wrap(err, "an error occurred during create indexing")
}
it.Reset(idx.indexDuration)
- case <-itl.C:
- err = idx.execute(grpc.WithGRPCMethod(ctx, "core.v1.Agent/CreateIndex"), false, false)
- if err != nil {
- ech <- err
- log.Error("an error occurred during indexing", err)
- err = nil
+ case <-itl.C: // index duration limit ticker
+ // execute CreateIndex. This execution always executes CreateIndex regardless of the state of the uncommitted index.
+ err = idx.createIndex(grpc.WithGRPCMethod(ctx, "core.v1.Agent/CreateIndex"), false)
+ if err != nil &&
+ !errors.Is(err, context.Canceled) &&
+ !errors.Is(err, context.DeadlineExceeded) {
+ err = errors.Wrap(err, "an error occurred during force create indexing")
}
itl.Reset(idx.indexDurationLimit)
- case <-stl.C:
- err = idx.execute(grpc.WithGRPCMethod(ctx, "core.v1.Agent/CreateAndSaveIndex"), false, true)
- if err != nil {
- ech <- err
- log.Error("an error occurred during indexing and saving", err)
- err = nil
- }
- stl.Reset(idx.saveIndexDurationLimit)
+ case <-st.C: // save index duration ticker
+ // execute SaveIndex in concurrent.
+ idx.eg.Go(safety.RecoverFunc(func() (err error) {
+ if !mu.TryLock() {
+ return
+ }
+ defer mu.Unlock()
+ defer st.Reset(idx.saveIndexDuration)
+ err = idx.saveIndex(grpc.WithGRPCMethod(ctx, "core.v1.Agent/SaveIndex"), false)
+ if err != nil &&
+ !errors.Is(err, context.Canceled) &&
+ !errors.Is(err, context.DeadlineExceeded) {
+ err = errors.Wrap(err, "an error occurred during save indexing")
+ log.Error(err)
+ select {
+ case <-ctx.Done():
+ return nil
+ case ech <- err:
+ }
+ }
+ return nil
+ }))
+ case <-stl.C: // save index duration limit ticker
+ // execute SaveIndex in concurrent.
+ idx.eg.Go(safety.RecoverFunc(func() (err error) {
+ if !mu.TryLock() {
+ return
+ }
+ defer mu.Unlock()
+ defer stl.Reset(idx.saveIndexDurationLimit)
+ err = idx.saveIndex(grpc.WithGRPCMethod(ctx, "core.v1.Agent/SaveIndex"), true)
+ if err != nil &&
+ !errors.Is(err, context.Canceled) &&
+ !errors.Is(err, context.DeadlineExceeded) {
+ err = errors.Wrap(err, "an error occurred during force save indexing")
+ log.Error(err)
+ select {
+ case <-ctx.Done():
+ return nil
+ case ech <- err:
+ }
+ }
+ return nil
+ }))
}
- if err != nil {
+ if err != nil &&
+ !errors.Is(err, context.Canceled) &&
+ !errors.Is(err, context.DeadlineExceeded) {
log.Error(err)
select {
case <-ctx.Done():
@@ -156,35 +206,10 @@ func (idx *index) Start(ctx context.Context) (<-chan error, error) {
}
}
}))
- idx.eg.Go(safety.RecoverFunc(func() (err error) {
- defer close(sech)
- for {
- select {
- case <-ctx.Done():
- return
- case addr := <-idx.saveIndexTargetAddrCh:
- idx.schMap.Delete(addr)
- _, err := idx.client.GetClient().
- Do(grpc.WithGRPCMethod(ctx, "core.v1.Agent/SaveIndex"), addr, func(ctx context.Context, conn *grpc.ClientConn, copts ...grpc.CallOption) (interface{}, error) {
- return agent.NewAgentClient(conn).SaveIndex(ctx, &payload.Empty{}, copts...)
- })
- if err != nil {
- log.Warnf("an error occurred while calling SaveIndex of %s: %s", addr, err)
- select {
- case <-ctx.Done():
- return nil
- case sech <- err:
- }
- }
- }
-
- idx.waitForNextSaving(ctx)
- }
- }))
return ech, nil
}
-func (idx *index) execute(ctx context.Context, enableLowIndexSkip, immediateSaving bool) (err error) {
+func (idx *index) createIndex(ctx context.Context, enableLowIndexSkip bool) (err error) {
ctx, span := trace.StartSpan(ctx, "vald/manager-index/service/Indexer.execute")
defer func() {
if span != nil {
@@ -192,79 +217,75 @@ func (idx *index) execute(ctx context.Context, enableLowIndexSkip, immediateSavi
}
}()
- if idx.indexing.Load().(bool) {
+ if idx.indexing.Load() {
return nil
}
idx.indexing.Store(true)
defer idx.indexing.Store(false)
- addrs := idx.client.GetAddrs(ctx)
- err = idx.client.GetClient().OrderedRangeConcurrent(ctx, addrs,
- idx.concurrency,
+ return errors.Join(idx.client.GetClient().OrderedRangeConcurrent(ctx, idx.client.GetAddrs(ctx),
+ idx.createIndexConcurrency,
func(ctx context.Context,
addr string, conn *grpc.ClientConn, copts ...grpc.CallOption,
) (err error) {
- select {
- case <-ctx.Done():
- return nil
- default:
- }
info, ok := idx.indexInfos.Load(addr)
if ok && (info.GetUncommitted() == 0 || (enableLowIndexSkip && info.GetUncommitted() < idx.minUncommitted)) {
return nil
}
- ac := agent.NewAgentClient(conn)
- req := &payload.Control_CreateIndexRequest{
+ _, err = agent.NewAgentClient(conn).CreateIndex(ctx, &payload.Control_CreateIndexRequest{
PoolSize: idx.creationPoolSize,
- }
- if !immediateSaving {
- _, err = ac.CreateIndex(ctx, req, copts...)
- if err != nil {
- st, ok := status.FromError(err)
- if ok && st != nil && st.Code() == codes.FailedPrecondition {
- log.Debugf("CreateIndex of %s skipped, message: %s, err: %v", addr, st.Message(), errors.Join(st.Err(), err))
- return nil
- }
- log.Warnf("an error occurred while calling CreateIndex of %s: %s", addr, err)
- return err
- }
- _, ok := idx.schMap.Load(addr)
- if !ok {
- select {
- case <-ctx.Done():
- case idx.saveIndexTargetAddrCh <- addr:
- idx.schMap.Store(addr, struct{}{})
- }
- }
- return nil
- }
- _, err = ac.CreateAndSaveIndex(ctx, req, copts...)
+ }, copts...)
if err != nil {
st, ok := status.FromError(err)
if ok && st != nil && st.Code() == codes.FailedPrecondition {
log.Debugf("CreateIndex of %s skipped, message: %s, err: %v", addr, st.Message(), errors.Join(st.Err(), err))
return nil
}
- log.Warnf("an error occurred while calling CreateAndSaveIndex of %s: %s", addr, err)
+ log.Warnf("an error occurred while calling CreateIndex of %s: %s", addr, err)
return err
}
- idx.waitForNextSaving(ctx)
+ _, ok = idx.shouldSaveList.LoadOrStore(addr, empty)
+ if ok {
+ log.Debugf("addr %s already queued for saveIndex", addr)
+ return nil
+ }
return nil
- })
- if err != nil {
- return err
- }
- return idx.loadInfos(ctx)
+ }), idx.loadInfos(ctx))
}
-func (idx *index) waitForNextSaving(ctx context.Context) {
- if idx.saveIndexWaitDuration > 0 {
- timer := time.NewTimer(idx.saveIndexWaitDuration)
- select {
- case <-ctx.Done():
- case <-timer.C:
+func (idx *index) saveIndex(ctx context.Context, force bool) (err error) {
+ ctx, span := trace.StartSpan(ctx, "vald/manager-index/service/Indexer.saveIndex")
+ defer func() {
+ if span != nil {
+ span.End()
}
- timer.Stop()
+ }()
+
+ if idx.saving.Load() {
+ return nil
}
+ idx.saving.Store(true)
+ defer idx.saving.Store(false)
+ return idx.client.GetClient().OrderedRangeConcurrent(ctx, idx.client.GetAddrs(ctx),
+ idx.saveIndexConcurrency,
+ func(ctx context.Context,
+ addr string, conn *grpc.ClientConn, copts ...grpc.CallOption,
+ ) (err error) {
+ _, ok := idx.shouldSaveList.LoadAndDelete(addr)
+ if !ok && !force {
+ return nil
+ }
+ _, err = agent.NewAgentClient(conn).SaveIndex(ctx, new(payload.Empty), copts...)
+ if err != nil {
+ st, ok := status.FromError(err)
+ if ok && st != nil && st.Code() == codes.FailedPrecondition {
+ log.Debugf("CreateIndex of %s skipped, message: %s, err: %v", addr, st.Message(), errors.Join(st.Err(), err))
+ return nil
+ }
+ log.Warnf("an error occurred while calling CreateIndex of %s: %s", addr, err)
+ return err
+ }
+ return nil
+ })
}
func (idx *index) loadInfos(ctx context.Context) (err error) {
@@ -285,7 +306,7 @@ func (idx *index) loadInfos(ctx context.Context) (err error) {
case <-ctx.Done():
return nil
default:
- info, err := agent.NewAgentClient(conn).IndexInfo(ctx, new(payload.Empty), copts...)
+ info, err := vald.NewValdClient(conn).IndexInfo(ctx, new(payload.Empty), copts...)
if err != nil {
log.Warnf("an error occurred while calling IndexInfo of %s: %s", addr, err)
return nil
@@ -318,7 +339,11 @@ func (idx *index) loadInfos(ctx context.Context) (err error) {
}
func (idx *index) IsIndexing() bool {
- return idx.indexing.Load().(bool)
+ return idx.indexing.Load()
+}
+
+func (idx *index) IsSaving() bool {
+ return idx.saving.Load()
}
func (idx *index) NumberOfUUIDs() uint32 {
@@ -328,3 +353,14 @@ func (idx *index) NumberOfUUIDs() uint32 {
func (idx *index) NumberOfUncommittedUUIDs() uint32 {
return atomic.LoadUint32(&idx.uncommittedUUIDsCount)
}
+
+func (idx *index) LoadIndexDetail() (detail *payload.Info_Index_Detail) {
+ detail = &payload.Info_Index_Detail{
+ Counts: make(map[string]*payload.Info_Index_Count, idx.indexInfos.Len()),
+ }
+ idx.indexInfos.Range(func(addr string, info *payload.Info_Index_Count) bool {
+ detail.Counts[addr] = info
+ return true
+ })
+ return detail
+}
diff --git a/pkg/manager/index/service/indexer_test.go b/pkg/manager/index/service/indexer_test.go
index 40854f98d6..f5cb8a5ce8 100644
--- a/pkg/manager/index/service/indexer_test.go
+++ b/pkg/manager/index/service/indexer_test.go
@@ -702,3 +702,148 @@ package service
// })
// }
// }
+//
+// func Test_index_LoadIndexDetail(t *testing.T) {
+// type fields struct {
+// client discoverer.Client
+// eg errgroup.Group
+// creationPoolSize uint32
+// indexDuration time.Duration
+// indexDurationLimit time.Duration
+// saveIndexDurationLimit time.Duration
+// saveIndexWaitDuration time.Duration
+// saveIndexTargetAddrCh chan string
+// schMap sync.Map[string, any]
+// concurrency int
+// indexInfos sync.Map[string, *payload.Info_Index_Count]
+// indexing atomic.Value
+// minUncommitted uint32
+// uuidsCount uint32
+// uncommittedUUIDsCount uint32
+// }
+// type want struct {
+// wantDetail *payload.Info_Index_Detail
+// }
+// type test struct {
+// name string
+// fields fields
+// want want
+// checkFunc func(want, *payload.Info_Index_Detail) error
+// beforeFunc func(*testing.T)
+// afterFunc func(*testing.T)
+// }
+// defaultCheckFunc := func(w want, gotDetail *payload.Info_Index_Detail) error {
+// if !reflect.DeepEqual(gotDetail, w.wantDetail) {
+// return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotDetail, w.wantDetail)
+// }
+// return nil
+// }
+// tests := []test{
+// // TODO test cases
+// /*
+// {
+// name: "test_case_1",
+// fields: fields {
+// client:nil,
+// eg:nil,
+// creationPoolSize:0,
+// indexDuration:nil,
+// indexDurationLimit:nil,
+// saveIndexDurationLimit:nil,
+// saveIndexWaitDuration:nil,
+// saveIndexTargetAddrCh:nil,
+// schMap:nil,
+// concurrency:0,
+// indexInfos:nil,
+// indexing:nil,
+// minUncommitted:0,
+// uuidsCount:0,
+// uncommittedUUIDsCount:0,
+// },
+// want: want{},
+// checkFunc: defaultCheckFunc,
+// beforeFunc: func(t *testing.T,) {
+// t.Helper()
+// },
+// afterFunc: func(t *testing.T,) {
+// t.Helper()
+// },
+// },
+// */
+//
+// // TODO test cases
+// /*
+// func() test {
+// return test {
+// name: "test_case_2",
+// fields: fields {
+// client:nil,
+// eg:nil,
+// creationPoolSize:0,
+// indexDuration:nil,
+// indexDurationLimit:nil,
+// saveIndexDurationLimit:nil,
+// saveIndexWaitDuration:nil,
+// saveIndexTargetAddrCh:nil,
+// schMap:nil,
+// concurrency:0,
+// indexInfos:nil,
+// indexing:nil,
+// minUncommitted:0,
+// uuidsCount:0,
+// uncommittedUUIDsCount:0,
+// },
+// want: want{},
+// checkFunc: defaultCheckFunc,
+// beforeFunc: func(t *testing.T,) {
+// t.Helper()
+// },
+// afterFunc: func(t *testing.T,) {
+// t.Helper()
+// },
+// }
+// }(),
+// */
+// }
+//
+// for _, tc := range tests {
+// test := tc
+// t.Run(test.name, func(tt *testing.T) {
+// tt.Parallel()
+// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent())
+// if test.beforeFunc != nil {
+// test.beforeFunc(tt)
+// }
+// if test.afterFunc != nil {
+// defer test.afterFunc(tt)
+// }
+// checkFunc := test.checkFunc
+// if test.checkFunc == nil {
+// checkFunc = defaultCheckFunc
+// }
+// idx := &index{
+// client: test.fields.client,
+// eg: test.fields.eg,
+// creationPoolSize: test.fields.creationPoolSize,
+// indexDuration: test.fields.indexDuration,
+// indexDurationLimit: test.fields.indexDurationLimit,
+// saveIndexDurationLimit: test.fields.saveIndexDurationLimit,
+// saveIndexWaitDuration: test.fields.saveIndexWaitDuration,
+// saveIndexTargetAddrCh: test.fields.saveIndexTargetAddrCh,
+// schMap: test.fields.schMap,
+// concurrency: test.fields.concurrency,
+// indexInfos: test.fields.indexInfos,
+// indexing: test.fields.indexing,
+// minUncommitted: test.fields.minUncommitted,
+// uuidsCount: test.fields.uuidsCount,
+// uncommittedUUIDsCount: test.fields.uncommittedUUIDsCount,
+// }
+//
+// gotDetail := idx.LoadIndexDetail()
+// if err := checkFunc(test.want, gotDetail); err != nil {
+// tt.Errorf("error = %v", err)
+// }
+//
+// })
+// }
+// }
diff --git a/pkg/manager/index/service/option.go b/pkg/manager/index/service/option.go
index c3fffb7dc2..ec6b76d662 100644
--- a/pkg/manager/index/service/option.go
+++ b/pkg/manager/index/service/option.go
@@ -31,7 +31,6 @@ var defaultOptions = []Option{
WithIndexingDuration("1m"),
WithIndexingDurationLimit("30m"),
WithSaveIndexDurationLimit("3h"),
- WithSaveIndexWaitDuration("10m"),
WithMinUncommitted(100),
WithCreationPoolSize(10000),
}
@@ -39,27 +38,22 @@ var defaultOptions = []Option{
func WithIndexingConcurrency(c int) Option {
return func(idx *index) error {
if c != 0 {
- idx.concurrency = c
+ idx.createIndexConcurrency = c
}
return nil
}
}
-func WithIndexingDuration(dur string) Option {
+func WithSaveConcurrency(c int) Option {
return func(idx *index) error {
- if dur == "" {
- return nil
- }
- d, err := timeutil.Parse(dur)
- if err != nil {
- return err
+ if c != 0 {
+ idx.saveIndexConcurrency = c
}
- idx.indexDuration = d
return nil
}
}
-func WithIndexingDurationLimit(dur string) Option {
+func WithIndexingDuration(dur string) Option {
return func(idx *index) error {
if dur == "" {
return nil
@@ -68,12 +62,12 @@ func WithIndexingDurationLimit(dur string) Option {
if err != nil {
return err
}
- idx.indexDurationLimit = d
+ idx.indexDuration = d
return nil
}
}
-func WithSaveIndexDurationLimit(dur string) Option {
+func WithIndexingDurationLimit(dur string) Option {
return func(idx *index) error {
if dur == "" {
return nil
@@ -82,12 +76,12 @@ func WithSaveIndexDurationLimit(dur string) Option {
if err != nil {
return err
}
- idx.saveIndexDurationLimit = d
+ idx.indexDurationLimit = d
return nil
}
}
-func WithSaveIndexWaitDuration(dur string) Option {
+func WithSaveIndexDurationLimit(dur string) Option {
return func(idx *index) error {
if dur == "" {
return nil
@@ -96,7 +90,7 @@ func WithSaveIndexWaitDuration(dur string) Option {
if err != nil {
return err
}
- idx.saveIndexWaitDuration = d
+ idx.saveIndexDurationLimit = d
return nil
}
}
diff --git a/pkg/manager/index/usecase/indexer.go b/pkg/manager/index/usecase/indexer.go
index a891fc487f..0591b32123 100644
--- a/pkg/manager/index/usecase/indexer.go
+++ b/pkg/manager/index/usecase/indexer.go
@@ -19,7 +19,7 @@ package usecase
import (
"context"
- "github.com/vdaas/vald/apis/grpc/v1/manager/index"
+ index "github.com/vdaas/vald/apis/grpc/v1/vald"
"github.com/vdaas/vald/internal/client/v1/client/discoverer"
iconf "github.com/vdaas/vald/internal/config"
"github.com/vdaas/vald/internal/net/grpc"
@@ -98,7 +98,6 @@ func New(cfg *config.Data) (r runner.Runner, err error) {
service.WithIndexingDuration(cfg.Indexer.AutoIndexCheckDuration),
service.WithIndexingDurationLimit(cfg.Indexer.AutoIndexDurationLimit),
service.WithSaveIndexDurationLimit(cfg.Indexer.AutoSaveIndexDurationLimit),
- service.WithSaveIndexWaitDuration(cfg.Indexer.AutoSaveIndexWaitDuration),
service.WithCreationPoolSize(cfg.Indexer.CreationPoolSize),
service.WithMinUncommitted(cfg.Indexer.AutoIndexLength),
)
diff --git a/pkg/tools/benchmark/job/handler/rest/handler.go b/pkg/tools/benchmark/job/handler/rest/handler.go
index 1de5069055..091b03c422 100644
--- a/pkg/tools/benchmark/job/handler/rest/handler.go
+++ b/pkg/tools/benchmark/job/handler/rest/handler.go
@@ -17,7 +17,7 @@
// Package rest provides rest api logic
package rest
-type Handler interface{}
+type Handler any
type handler struct{}
diff --git a/pkg/tools/benchmark/job/service/option.go b/pkg/tools/benchmark/job/service/option.go
index 4b0fb7e459..f0a1764d9d 100644
--- a/pkg/tools/benchmark/job/service/option.go
+++ b/pkg/tools/benchmark/job/service/option.go
@@ -130,7 +130,8 @@ func WithHdf5(d hdf5.Data) Option {
}
}
-// WithDataset sets the config.BenchmarkDataset including benchmark dataset name, group name of hdf5.Data, the number of index, start range and end range, and original URL which is used for download user defined hdf5.
+// WithDataset sets the config.BenchmarkDataset including benchmark dataset name, group name of hdf5.Data, the number of index, start range and end range, and
+// original URL which is used for download user defined hdf5.
func WithDataset(d *config.BenchmarkDataset) Option {
return func(j *job) error {
if d == nil {
diff --git a/pkg/tools/benchmark/operator/config/config.go b/pkg/tools/benchmark/operator/config/config.go
index 29c2ad522e..6881ff91e8 100644
--- a/pkg/tools/benchmark/operator/config/config.go
+++ b/pkg/tools/benchmark/operator/config/config.go
@@ -17,9 +17,7 @@
// Package config stores all server application settings
package config
-import (
- "github.com/vdaas/vald/internal/config"
-)
+import "github.com/vdaas/vald/internal/config"
// GlobalConfig is type alias for config.GlobalConfig.
type GlobalConfig = config.GlobalConfig
diff --git a/pkg/tools/benchmark/operator/handler/rest/handler.go b/pkg/tools/benchmark/operator/handler/rest/handler.go
index 1de5069055..091b03c422 100644
--- a/pkg/tools/benchmark/operator/handler/rest/handler.go
+++ b/pkg/tools/benchmark/operator/handler/rest/handler.go
@@ -17,7 +17,7 @@
// Package rest provides rest api logic
package rest
-type Handler interface{}
+type Handler any
type handler struct{}
diff --git a/pkg/tools/benchmark/operator/service/operator.go b/pkg/tools/benchmark/operator/service/operator.go
index 438967f1fa..187673d527 100644
--- a/pkg/tools/benchmark/operator/service/operator.go
+++ b/pkg/tools/benchmark/operator/service/operator.go
@@ -237,7 +237,9 @@ func (o *operator) jobReconcile(ctx context.Context, jobList map[string][]k8s.Jo
// benchJobReconcile gets the vald benchmark job resource list and create Job for running benchmark job.
// skipcq: GO-R1005
-func (o *operator) benchJobReconcile(ctx context.Context, benchJobList map[string]v1.ValdBenchmarkJob) {
+func (o *operator) benchJobReconcile(
+ ctx context.Context, benchJobList map[string]v1.ValdBenchmarkJob,
+) {
log.Debugf("[reconcile benchmark job resource] job list: %#v", benchJobList)
cbjl := o.getAtomicBenchJob()
if cbjl == nil {
@@ -315,7 +317,9 @@ func (o *operator) benchJobReconcile(ctx context.Context, benchJobList map[strin
}
// benchScenarioReconcile gets the vald benchmark scenario list and create vald benchmark job resource according to it.
-func (o *operator) benchScenarioReconcile(ctx context.Context, scenarioList map[string]v1.ValdBenchmarkScenario) {
+func (o *operator) benchScenarioReconcile(
+ ctx context.Context, scenarioList map[string]v1.ValdBenchmarkScenario,
+) {
log.Debugf("[reconcile benchmark scenario resource] scenario list: %#v", scenarioList)
cbsl := o.getAtomicScenario()
if cbsl == nil {
@@ -422,7 +426,9 @@ func (o *operator) deleteJob(ctx context.Context, name string) error {
}
// createBenchmarkJob creates the ValdBenchmarkJob crd for running job.
-func (o *operator) createBenchmarkJob(ctx context.Context, scenario v1.ValdBenchmarkScenario) ([]string, error) {
+func (o *operator) createBenchmarkJob(
+ ctx context.Context, scenario v1.ValdBenchmarkScenario,
+) ([]string, error) {
ownerRef := []k8s.OwnerReference{
{
APIVersion: scenario.APIVersion,
@@ -514,7 +520,9 @@ func (o *operator) createJob(ctx context.Context, bjr v1.ValdBenchmarkJob) error
}
// updateBenchmarkScenarioStatus updates status of ValdBenchmarkScenarioResource.
-func (o *operator) updateBenchmarkScenarioStatus(ctx context.Context, ss map[string]v1.ValdBenchmarkScenarioStatus) ([]string, error) {
+func (o *operator) updateBenchmarkScenarioStatus(
+ ctx context.Context, ss map[string]v1.ValdBenchmarkScenarioStatus,
+) ([]string, error) {
var sns []string
if cbsl := o.getAtomicScenario(); cbsl != nil {
for name, status := range ss {
@@ -537,7 +545,9 @@ func (o *operator) updateBenchmarkScenarioStatus(ctx context.Context, ss map[str
}
// updateBenchmarkJobStatus updates status of ValdBenchmarkJobResource.
-func (o *operator) updateBenchmarkJobStatus(ctx context.Context, js map[string]v1.BenchmarkJobStatus) ([]string, error) {
+func (o *operator) updateBenchmarkJobStatus(
+ ctx context.Context, js map[string]v1.BenchmarkJobStatus,
+) ([]string, error) {
var jns []string
if cbjl := o.getAtomicBenchJob(); cbjl != nil {
for name, status := range js {
diff --git a/pkg/tools/cli/loadtest/assets/dataset.go b/pkg/tools/cli/loadtest/assets/dataset.go
index f1f6d2afd2..acd03fd924 100644
--- a/pkg/tools/cli/loadtest/assets/dataset.go
+++ b/pkg/tools/cli/loadtest/assets/dataset.go
@@ -28,9 +28,9 @@ var ErrOutOfBounds = x1b.ErrOutOfBounds
// Dataset is representation of train and test dataset.
type Dataset interface {
- Train(i int) (interface{}, error)
+ Train(i int) (any, error)
TrainSize() int
- Query(i int) (interface{}, error)
+ Query(i int) (any, error)
QuerySize() int
Distance(i int) ([]float32, error)
DistanceSize() int
diff --git a/pkg/tools/cli/loadtest/assets/hdf5_loader.go b/pkg/tools/cli/loadtest/assets/hdf5_loader.go
index 482dabba32..c06dea16cc 100644
--- a/pkg/tools/cli/loadtest/assets/hdf5_loader.go
+++ b/pkg/tools/cli/loadtest/assets/hdf5_loader.go
@@ -18,9 +18,9 @@ import (
"gonum.org/v1/hdf5"
)
-type loaderFunc func(*hdf5.Dataset, int, int, int) (interface{}, error)
+type loaderFunc func(*hdf5.Dataset, int, int, int) (any, error)
-func loadFloat32(dset *hdf5.Dataset, npoints, row, dim int) (interface{}, error) {
+func loadFloat32(dset *hdf5.Dataset, npoints, row, dim int) (any, error) {
v := make([]float32, npoints)
if err := dset.Read(&v); err != nil {
return nil, err
@@ -36,7 +36,7 @@ func loadFloat32(dset *hdf5.Dataset, npoints, row, dim int) (interface{}, error)
return vec, nil
}
-func loadInt(dset *hdf5.Dataset, npoints, row, dim int) (interface{}, error) {
+func loadInt(dset *hdf5.Dataset, npoints, row, dim int) (any, error) {
v := make([]int32, npoints)
if err := dset.Read(&v); err != nil {
return nil, err
@@ -52,7 +52,7 @@ func loadInt(dset *hdf5.Dataset, npoints, row, dim int) (interface{}, error) {
return vec, nil
}
-func loadDataset(file *hdf5.File, name string, f loaderFunc) (dim int, vec interface{}, err error) {
+func loadDataset(file *hdf5.File, name string, f loaderFunc) (dim int, vec any, err error) {
dset, err := file.OpenDataset(name)
if err != nil {
return 0, nil, err
diff --git a/pkg/tools/cli/loadtest/assets/large_dataset.go b/pkg/tools/cli/loadtest/assets/large_dataset.go
index 5621b67b37..1649fea69f 100644
--- a/pkg/tools/cli/loadtest/assets/large_dataset.go
+++ b/pkg/tools/cli/loadtest/assets/large_dataset.go
@@ -31,7 +31,9 @@ type largeDataset struct {
distances x1b.FloatVectors
}
-func loadLargeData(trainFileName, queryFileName, groundTruthFileName, distanceFileName, name, distanceType, objectType string) func() (Dataset, error) {
+func loadLargeData(
+ trainFileName, queryFileName, groundTruthFileName, distanceFileName, name, distanceType, objectType string,
+) func() (Dataset, error) {
return func() (Dataset, error) {
dir, err := findDir(largeDatasetPath)
if err != nil {
@@ -86,7 +88,7 @@ func loadLargeData(trainFileName, queryFileName, groundTruthFileName, distanceFi
}
}
-func (d *largeDataset) Train(i int) (interface{}, error) {
+func (d *largeDataset) Train(i int) (any, error) {
return d.train.Load(i)
}
@@ -94,7 +96,7 @@ func (d *largeDataset) TrainSize() int {
return d.train.Size()
}
-func (d *largeDataset) Query(i int) (interface{}, error) {
+func (d *largeDataset) Query(i int) (any, error) {
return d.query.Load(i)
}
diff --git a/pkg/tools/cli/loadtest/assets/large_dataset_test.go b/pkg/tools/cli/loadtest/assets/large_dataset_test.go
index bf310dc49b..1c9ce5525b 100644
--- a/pkg/tools/cli/loadtest/assets/large_dataset_test.go
+++ b/pkg/tools/cli/loadtest/assets/large_dataset_test.go
@@ -27,7 +27,7 @@ package assets
// distances x1b.FloatVectors
// }
// type want struct {
-// want interface{}
+// want any
// err error
// }
// type test struct {
@@ -35,11 +35,11 @@ package assets
// args args
// fields fields
// want want
-// checkFunc func(want, interface{}, error) error
+// checkFunc func(want, any, error) error
// beforeFunc func(*testing.T, args)
// afterFunc func(*testing.T, args)
// }
-// defaultCheckFunc := func(w want, got interface{}, err error) error {
+// defaultCheckFunc := func(w want, got any, err error) error {
// if !errors.Is(err, w.err) {
// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err)
// }
@@ -251,7 +251,7 @@ package assets
// distances x1b.FloatVectors
// }
// type want struct {
-// want interface{}
+// want any
// err error
// }
// type test struct {
@@ -259,11 +259,11 @@ package assets
// args args
// fields fields
// want want
-// checkFunc func(want, interface{}, error) error
+// checkFunc func(want, any, error) error
// beforeFunc func(*testing.T, args)
// afterFunc func(*testing.T, args)
// }
-// defaultCheckFunc := func(w want, got interface{}, err error) error {
+// defaultCheckFunc := func(w want, got any, err error) error {
// if !errors.Is(err, w.err) {
// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err)
// }
diff --git a/pkg/tools/cli/loadtest/assets/small_dataset.go b/pkg/tools/cli/loadtest/assets/small_dataset.go
index ed9cb82919..52e141cc1e 100644
--- a/pkg/tools/cli/loadtest/assets/small_dataset.go
+++ b/pkg/tools/cli/loadtest/assets/small_dataset.go
@@ -129,7 +129,7 @@ func gaussian(dim, size int, mean, stdDev float64) func() (Dataset, error) {
}
// Train returns vectors for train.
-func (s *smallDataset) Train(i int) (interface{}, error) {
+func (s *smallDataset) Train(i int) (any, error) {
if i >= len(s.train) {
return nil, ErrOutOfBounds
}
@@ -142,7 +142,7 @@ func (s *smallDataset) TrainSize() int {
}
// Query returns vectors for test.
-func (s *smallDataset) Query(i int) (interface{}, error) {
+func (s *smallDataset) Query(i int) (any, error) {
if i >= len(s.query) {
return nil, ErrOutOfBounds
}
diff --git a/pkg/tools/cli/loadtest/assets/small_dataset_test.go b/pkg/tools/cli/loadtest/assets/small_dataset_test.go
index 2b1bf9f5da..a3b0536f09 100644
--- a/pkg/tools/cli/loadtest/assets/small_dataset_test.go
+++ b/pkg/tools/cli/loadtest/assets/small_dataset_test.go
@@ -27,7 +27,7 @@ package assets
// neighbors [][]int
// }
// type want struct {
-// want interface{}
+// want any
// err error
// }
// type test struct {
@@ -35,11 +35,11 @@ package assets
// args args
// fields fields
// want want
-// checkFunc func(want, interface{}, error) error
+// checkFunc func(want, any, error) error
// beforeFunc func(*testing.T, args)
// afterFunc func(*testing.T, args)
// }
-// defaultCheckFunc := func(w want, got interface{}, err error) error {
+// defaultCheckFunc := func(w want, got any, err error) error {
// if !errors.Is(err, w.err) {
// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err)
// }
@@ -251,7 +251,7 @@ package assets
// neighbors [][]int
// }
// type want struct {
-// want interface{}
+// want any
// err error
// }
// type test struct {
@@ -259,11 +259,11 @@ package assets
// args args
// fields fields
// want want
-// checkFunc func(want, interface{}, error) error
+// checkFunc func(want, any, error) error
// beforeFunc func(*testing.T, args)
// afterFunc func(*testing.T, args)
// }
-// defaultCheckFunc := func(w want, got interface{}, err error) error {
+// defaultCheckFunc := func(w want, got any, err error) error {
// if !errors.Is(err, w.err) {
// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err)
// }
diff --git a/pkg/tools/cli/loadtest/service/insert.go b/pkg/tools/cli/loadtest/service/insert.go
index 087fab4ac9..54562961c5 100644
--- a/pkg/tools/cli/loadtest/service/insert.go
+++ b/pkg/tools/cli/loadtest/service/insert.go
@@ -25,7 +25,9 @@ import (
"github.com/vdaas/vald/pkg/tools/cli/loadtest/assets"
)
-func insertRequestProvider(dataset assets.Dataset, batchSize int) (f func() interface{}, size int, err error) {
+func insertRequestProvider(
+ dataset assets.Dataset, batchSize int,
+) (f func() any, size int, err error) {
switch {
case batchSize == 1:
f, size = objectVectorProvider(dataset)
@@ -40,10 +42,10 @@ func insertRequestProvider(dataset assets.Dataset, batchSize int) (f func() inte
return f, size, nil
}
-func objectVectorProvider(dataset assets.Dataset) (func() interface{}, int) {
+func objectVectorProvider(dataset assets.Dataset) (func() any, int) {
idx := int32(-1)
size := dataset.TrainSize()
- return func() (ret interface{}) {
+ return func() (ret any) {
if i := int(atomic.AddInt32(&idx, 1)); i < size {
v, err := dataset.Train(i)
if err != nil {
@@ -60,13 +62,13 @@ func objectVectorProvider(dataset assets.Dataset) (func() interface{}, int) {
}, size
}
-func objectVectorsProvider(dataset assets.Dataset, n int) (func() interface{}, int) {
+func objectVectorsProvider(dataset assets.Dataset, n int) (func() any, int) {
provider, s := objectVectorProvider(dataset)
size := s / n
if s%n != 0 {
size = size + 1
}
- return func() (ret interface{}) {
+ return func() (ret any) {
r := make([]*payload.Insert_Request, 0, n)
for i := 0; i < n; i++ {
d := provider()
@@ -87,11 +89,11 @@ func objectVectorsProvider(dataset assets.Dataset, n int) (func() interface{}, i
func (l *loader) newInsert() (f loadFunc, err error) {
switch {
case l.batchSize == 1:
- f = func(ctx context.Context, conn *grpc.ClientConn, i interface{}, copts ...grpc.CallOption) (interface{}, error) {
+ f = func(ctx context.Context, conn *grpc.ClientConn, i any, copts ...grpc.CallOption) (any, error) {
return vald.NewInsertClient(conn).Insert(ctx, i.(*payload.Insert_Request), copts...)
}
case l.batchSize >= 2:
- f = func(ctx context.Context, conn *grpc.ClientConn, i interface{}, copts ...grpc.CallOption) (interface{}, error) {
+ f = func(ctx context.Context, conn *grpc.ClientConn, i any, copts ...grpc.CallOption) (any, error) {
return vald.NewInsertClient(conn).MultiInsert(ctx, i.(*payload.Insert_MultiRequest), copts...)
}
default:
@@ -105,7 +107,7 @@ func (l *loader) newInsert() (f loadFunc, err error) {
func (l *loader) newStreamInsert() (f loadFunc, err error) {
l.batchSize = 1
- return func(ctx context.Context, conn *grpc.ClientConn, i interface{}, copts ...grpc.CallOption) (interface{}, error) {
+ return func(ctx context.Context, conn *grpc.ClientConn, i any, copts ...grpc.CallOption) (any, error) {
return vald.NewValdClient(conn).StreamInsert(ctx, copts...)
}, nil
}
diff --git a/pkg/tools/cli/loadtest/service/loader.go b/pkg/tools/cli/loadtest/service/loader.go
index 7a12be9f9d..c22c500f47 100644
--- a/pkg/tools/cli/loadtest/service/loader.go
+++ b/pkg/tools/cli/loadtest/service/loader.go
@@ -38,7 +38,7 @@ type Loader interface {
}
type (
- loadFunc func(context.Context, *grpc.ClientConn, interface{}, ...grpc.CallOption) (interface{}, error)
+ loadFunc func(context.Context, *grpc.ClientConn, any, ...grpc.CallOption) (any, error)
)
type loader struct {
@@ -50,7 +50,7 @@ type loader struct {
dataset string
progressDuration time.Duration
loaderFunc loadFunc
- dataProvider func() interface{}
+ dataProvider func() any
dataSize int
operation config.Operation
}
@@ -135,7 +135,7 @@ func (l *loader) Do(ctx context.Context) <-chan error {
log.Infof("progress %d requests, %f[vps], error: %d", pgCnt, vps(int(pgCnt)*l.batchSize, start, time.Now()), errCnt)
}
- f := func(i interface{}, err error) {
+ f := func(i any, err error) {
atomic.AddInt32(&pgCnt, 1)
if err != nil {
atomic.AddInt32(&errCnt, 1)
@@ -183,19 +183,21 @@ func (l *loader) Do(ctx context.Context) <-chan error {
return ech
}
-func (l *loader) do(ctx context.Context, f func(interface{}, error), notify func(context.Context, error)) (err error) {
+func (l *loader) do(
+ ctx context.Context, f func(any, error), notify func(context.Context, error),
+) (err error) {
eg, egctx := errgroup.New(ctx)
switch l.operation {
case config.StreamInsert, config.StreamSearch:
- var newData func() interface{}
+ var newData func() any
switch l.operation {
case config.StreamInsert:
- newData = func() interface{} {
+ newData = func() any {
return new(payload.Empty)
}
case config.StreamSearch:
- newData = func() interface{} {
+ newData = func() any {
return new(payload.Search_Response)
}
}
@@ -206,7 +208,7 @@ func (l *loader) do(ctx context.Context, f func(interface{}, error), notify func
err = nil
}
}()
- _, err = l.client.Do(egctx, l.addr, func(ctx context.Context, conn *grpc.ClientConn, copts ...grpc.CallOption) (interface{}, error) {
+ _, err = l.client.Do(egctx, l.addr, func(ctx context.Context, conn *grpc.ClientConn, copts ...grpc.CallOption) (any, error) {
st, err := l.loaderFunc(ctx, conn, nil, copts...)
if err != nil {
return nil, err
@@ -230,7 +232,7 @@ func (l *loader) do(ctx context.Context, f func(interface{}, error), notify func
notify(egctx, err)
err = nil
}()
- _, err = l.client.Do(egctx, l.addr, func(ctx context.Context, conn *grpc.ClientConn, copts ...grpc.CallOption) (interface{}, error) {
+ _, err = l.client.Do(egctx, l.addr, func(ctx context.Context, conn *grpc.ClientConn, copts ...grpc.CallOption) (any, error) {
res, err := l.loaderFunc(egctx, conn, r)
f(res, err)
return res, err
diff --git a/pkg/tools/cli/loadtest/service/loader_test.go b/pkg/tools/cli/loadtest/service/loader_test.go
index 4c8324f35e..963f89bc9c 100644
--- a/pkg/tools/cli/loadtest/service/loader_test.go
+++ b/pkg/tools/cli/loadtest/service/loader_test.go
@@ -118,7 +118,7 @@ package service
// dataset string
// progressDuration time.Duration
// loaderFunc loadFunc
-// dataProvider func() interface{}
+// dataProvider func() any
// dataSize int
// operation config.Operation
// }
@@ -257,7 +257,7 @@ package service
// dataset string
// progressDuration time.Duration
// loaderFunc loadFunc
-// dataProvider func() interface{}
+// dataProvider func() any
// dataSize int
// operation config.Operation
// }
diff --git a/pkg/tools/cli/loadtest/service/search.go b/pkg/tools/cli/loadtest/service/search.go
index 7b5091dc9e..722a924d7c 100644
--- a/pkg/tools/cli/loadtest/service/search.go
+++ b/pkg/tools/cli/loadtest/service/search.go
@@ -23,10 +23,10 @@ import (
"github.com/vdaas/vald/pkg/tools/cli/loadtest/assets"
)
-func searchRequestProvider(dataset assets.Dataset) (func() interface{}, int, error) {
+func searchRequestProvider(dataset assets.Dataset) (func() any, int, error) {
size := dataset.QuerySize()
idx := int32(-1)
- return func() (ret interface{}) {
+ return func() (ret any) {
if i := int(atomic.AddInt32(&idx, 1)); i < size {
v, err := dataset.Query(i)
if err != nil {
@@ -41,13 +41,13 @@ func searchRequestProvider(dataset assets.Dataset) (func() interface{}, int, err
}
func (l *loader) newSearch() (loadFunc, error) {
- return func(ctx context.Context, conn *grpc.ClientConn, i interface{}, copts ...grpc.CallOption) (interface{}, error) {
+ return func(ctx context.Context, conn *grpc.ClientConn, i any, copts ...grpc.CallOption) (any, error) {
return vald.NewSearchClient(conn).Search(ctx, i.(*payload.Search_Request), copts...)
}, nil
}
func (l *loader) newStreamSearch() (loadFunc, error) {
- return func(ctx context.Context, conn *grpc.ClientConn, i interface{}, copts ...grpc.CallOption) (interface{}, error) {
+ return func(ctx context.Context, conn *grpc.ClientConn, i any, copts ...grpc.CallOption) (any, error) {
return vald.NewSearchClient(conn).StreamSearch(ctx, copts...)
}, nil
}
diff --git a/rust/Cargo.lock b/rust/Cargo.lock
index d1f80abe16..fc08c7d7d5 100644
--- a/rust/Cargo.lock
+++ b/rust/Cargo.lock
@@ -4,9 +4,9 @@ version = 3
[[package]]
name = "addr2line"
-version = "0.21.0"
+version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb"
+checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678"
dependencies = [
"gimli",
]
@@ -26,9 +26,9 @@ dependencies = [
[[package]]
name = "anyhow"
-version = "1.0.83"
+version = "1.0.86"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3"
+checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da"
[[package]]
name = "async-stream"
@@ -54,9 +54,9 @@ dependencies = [
[[package]]
name = "async-trait"
-version = "0.1.80"
+version = "0.1.81"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca"
+checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107"
dependencies = [
"proc-macro2",
"quote",
@@ -116,9 +116,9 @@ dependencies = [
[[package]]
name = "backtrace"
-version = "0.3.71"
+version = "0.3.73"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d"
+checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a"
dependencies = [
"addr2line",
"cc",
@@ -152,21 +152,21 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitflags"
-version = "2.5.0"
+version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1"
+checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
[[package]]
name = "bytes"
-version = "1.6.0"
+version = "1.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9"
+checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952"
[[package]]
name = "cc"
-version = "1.0.97"
+version = "1.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4"
+checksum = "2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f"
[[package]]
name = "cfg-if"
@@ -186,9 +186,9 @@ dependencies = [
[[package]]
name = "cxx"
-version = "1.0.122"
+version = "1.0.124"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bb497fad022245b29c2a0351df572e2d67c1046bcef2260ebc022aec81efea82"
+checksum = "273dcfd3acd4e1e276af13ed2a43eea7001318823e7a726a6b3ed39b4acc0b82"
dependencies = [
"cc",
"cxxbridge-flags",
@@ -198,9 +198,9 @@ dependencies = [
[[package]]
name = "cxx-build"
-version = "1.0.122"
+version = "1.0.124"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9327c7f9fbd6329a200a5d4aa6f674c60ab256525ff0084b52a889d4e4c60cee"
+checksum = "d8b2766fbd92be34e9ed143898fce6c572dc009de39506ed6903e5a05b68914e"
dependencies = [
"cc",
"codespan-reporting",
@@ -213,15 +213,15 @@ dependencies = [
[[package]]
name = "cxxbridge-flags"
-version = "1.0.122"
+version = "1.0.124"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "688c799a4a846f1c0acb9f36bb9c6272d9b3d9457f3633c7753c6057270df13c"
+checksum = "839fcd5e43464614ffaa989eaf1c139ef1f0c51672a1ed08023307fa1b909ccd"
[[package]]
name = "cxxbridge-macro"
-version = "1.0.122"
+version = "1.0.124"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "928bc249a7e3cd554fd2e8e08a426e9670c50bbfc9a621653cfa9accc9641783"
+checksum = "4b2c1c1776b986979be68bb2285da855f8d8a35851a769fca8740df7c3d07877"
dependencies = [
"proc-macro2",
"quote",
@@ -230,9 +230,9 @@ dependencies = [
[[package]]
name = "either"
-version = "1.11.0"
+version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2"
+checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
[[package]]
name = "equivalent"
@@ -242,9 +242,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
[[package]]
name = "errno"
-version = "0.3.8"
+version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245"
+checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba"
dependencies = [
"libc",
"windows-sys 0.52.0",
@@ -308,9 +308,9 @@ dependencies = [
[[package]]
name = "gimli"
-version = "0.28.1"
+version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
+checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd"
[[package]]
name = "h2"
@@ -367,9 +367,9 @@ dependencies = [
[[package]]
name = "httparse"
-version = "1.8.0"
+version = "1.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904"
+checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9"
[[package]]
name = "httpdate"
@@ -379,9 +379,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
[[package]]
name = "hyper"
-version = "0.14.28"
+version = "0.14.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80"
+checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9"
dependencies = [
"bytes",
"futures-channel",
@@ -456,9 +456,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
[[package]]
name = "libc"
-version = "0.2.154"
+version = "0.2.155"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346"
+checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
[[package]]
name = "link-cplusplus"
@@ -471,9 +471,9 @@ dependencies = [
[[package]]
name = "linux-raw-sys"
-version = "0.4.13"
+version = "0.4.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c"
+checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89"
[[package]]
name = "matchit"
@@ -483,9 +483,9 @@ checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94"
[[package]]
name = "memchr"
-version = "2.7.2"
+version = "2.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d"
+checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
[[package]]
name = "miette"
@@ -526,22 +526,23 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
[[package]]
name = "miniz_oxide"
-version = "0.7.2"
+version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7"
+checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08"
dependencies = [
"adler",
]
[[package]]
name = "mio"
-version = "0.8.11"
+version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c"
+checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4"
dependencies = [
+ "hermit-abi",
"libc",
"wasi",
- "windows-sys 0.48.0",
+ "windows-sys 0.52.0",
]
[[package]]
@@ -564,9 +565,9 @@ dependencies = [
[[package]]
name = "object"
-version = "0.32.2"
+version = "0.36.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441"
+checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e"
dependencies = [
"memchr",
]
@@ -584,6 +585,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "caff54706df99d2a78a5a4e3455ff45448d81ef1bb63c22cd14052ca0e993a3f"
[[package]]
+<<<<<<< HEAD
+=======
+name = "parking_lot"
+version = "0.12.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27"
+dependencies = [
+ "lock_api",
+ "parking_lot_core",
+]
+
+[[package]]
+name = "parking_lot_core"
+version = "0.9.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "redox_syscall",
+ "smallvec",
+ "windows-targets 0.52.6",
+]
+
+[[package]]
+>>>>>>> 76eb8d7b5 (refactor index manager service add index service API to expose index informations (#2525))
name = "percent-encoding"
version = "2.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -629,18 +656,18 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
[[package]]
name = "proc-macro2"
-version = "1.0.82"
+version = "1.0.86"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b"
+checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"
dependencies = [
"unicode-ident",
]
[[package]]
name = "prost"
-version = "0.12.4"
+version = "0.12.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d0f5d036824e4761737860779c906171497f6d55681139d8312388f8fe398922"
+checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29"
dependencies = [
"bytes",
"prost-derive",
@@ -648,9 +675,9 @@ dependencies = [
[[package]]
name = "prost-derive"
-version = "0.12.4"
+version = "0.12.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "19de2de2a00075bf566bee3bd4db014b11587e84184d3f7a791bc17f1a8e9e48"
+checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1"
dependencies = [
"anyhow",
"itertools",
@@ -661,9 +688,9 @@ dependencies = [
[[package]]
name = "prost-types"
-version = "0.12.4"
+version = "0.12.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3235c33eb02c1f1e212abdbe34c78b264b038fb58ca612664343271e36e55ffe"
+checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0"
dependencies = [
"prost",
]
@@ -718,6 +745,18 @@ dependencies = [
]
[[package]]
+<<<<<<< HEAD
+=======
+name = "redox_syscall"
+version = "0.5.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4"
+dependencies = [
+ "bitflags 2.6.0",
+]
+
+[[package]]
+>>>>>>> 76eb8d7b5 (refactor index manager service add index service API to expose index informations (#2525))
name = "rustc-demangle"
version = "0.1.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -729,7 +768,7 @@ version = "0.38.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f"
dependencies = [
- "bitflags 2.5.0",
+ "bitflags 2.6.0",
"errno",
"libc",
"linux-raw-sys",
@@ -738,9 +777,9 @@ dependencies = [
[[package]]
name = "rustversion"
-version = "1.0.16"
+version = "1.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "092474d1a01ea8278f69e6a358998405fae5b8b963ddaeb2b0b04a128bf1dfb0"
+checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6"
[[package]]
name = "scratch"
@@ -750,18 +789,18 @@ checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152"
[[package]]
name = "serde"
-version = "1.0.201"
+version = "1.0.204"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "780f1cebed1629e4753a1a38a3c72d30b97ec044f0aef68cb26650a3c5cf363c"
+checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
-version = "1.0.201"
+version = "1.0.204"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865"
+checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222"
dependencies = [
"proc-macro2",
"quote",
@@ -816,9 +855,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2"
[[package]]
name = "syn"
-version = "2.0.61"
+version = "2.0.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9"
+checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af"
dependencies = [
"proc-macro2",
"quote",
@@ -863,18 +902,18 @@ dependencies = [
[[package]]
name = "thiserror"
-version = "1.0.60"
+version = "1.0.63"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18"
+checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
-version = "1.0.60"
+version = "1.0.63"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524"
+checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261"
dependencies = [
"proc-macro2",
"quote",
@@ -883,17 +922,26 @@ dependencies = [
[[package]]
name = "tokio"
-version = "1.37.0"
+version = "1.39.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787"
+checksum = "d040ac2b29ab03b09d4129c2f5bbd012a3ac2f79d38ff506a4bf8dd34b0eac8a"
dependencies = [
"backtrace",
"bytes",
"libc",
"mio",
+<<<<<<< HEAD
+=======
+ "parking_lot",
+>>>>>>> 76eb8d7b5 (refactor index manager service add index service API to expose index informations (#2525))
"pin-project-lite",
"socket2",
+<<<<<<< HEAD
"windows-sys 0.48.0",
+=======
+ "tokio-macros",
+ "windows-sys 0.52.0",
+>>>>>>> 76eb8d7b5 (refactor index manager service add index service API to expose index informations (#2525))
]
[[package]]
@@ -907,6 +955,20 @@ dependencies = [
]
[[package]]
+<<<<<<< HEAD
+=======
+name = "tokio-macros"
+version = "2.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+>>>>>>> 76eb8d7b5 (refactor index manager service add index service API to expose index informations (#2525))
name = "tokio-stream"
version = "0.1.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1051,9 +1113,9 @@ checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f"
[[package]]
name = "unicode-width"
-version = "0.1.12"
+version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6"
+checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d"
[[package]]
name = "want"
@@ -1094,7 +1156,7 @@ version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
dependencies = [
- "windows-targets 0.52.5",
+ "windows-targets 0.52.6",
]
[[package]]
@@ -1114,18 +1176,18 @@ dependencies = [
[[package]]
name = "windows-targets"
-version = "0.52.5"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb"
+checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
dependencies = [
- "windows_aarch64_gnullvm 0.52.5",
- "windows_aarch64_msvc 0.52.5",
- "windows_i686_gnu 0.52.5",
+ "windows_aarch64_gnullvm 0.52.6",
+ "windows_aarch64_msvc 0.52.6",
+ "windows_i686_gnu 0.52.6",
"windows_i686_gnullvm",
- "windows_i686_msvc 0.52.5",
- "windows_x86_64_gnu 0.52.5",
- "windows_x86_64_gnullvm 0.52.5",
- "windows_x86_64_msvc 0.52.5",
+ "windows_i686_msvc 0.52.6",
+ "windows_x86_64_gnu 0.52.6",
+ "windows_x86_64_gnullvm 0.52.6",
+ "windows_x86_64_msvc 0.52.6",
]
[[package]]
@@ -1136,9 +1198,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
[[package]]
name = "windows_aarch64_gnullvm"
-version = "0.52.5"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263"
+checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]]
name = "windows_aarch64_msvc"
@@ -1148,9 +1210,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
[[package]]
name = "windows_aarch64_msvc"
-version = "0.52.5"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6"
+checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]]
name = "windows_i686_gnu"
@@ -1160,15 +1222,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
[[package]]
name = "windows_i686_gnu"
-version = "0.52.5"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670"
+checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
[[package]]
name = "windows_i686_gnullvm"
-version = "0.52.5"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9"
+checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]]
name = "windows_i686_msvc"
@@ -1178,9 +1240,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
[[package]]
name = "windows_i686_msvc"
-version = "0.52.5"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf"
+checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]]
name = "windows_x86_64_gnu"
@@ -1190,9 +1252,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
[[package]]
name = "windows_x86_64_gnu"
-version = "0.52.5"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9"
+checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]]
name = "windows_x86_64_gnullvm"
@@ -1202,9 +1264,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
[[package]]
name = "windows_x86_64_gnullvm"
-version = "0.52.5"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596"
+checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]]
name = "windows_x86_64_msvc"
@@ -1214,6 +1276,6 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
[[package]]
name = "windows_x86_64_msvc"
-version = "0.52.5"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
+checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
diff --git a/rust/bin/agent/src/handler/index.rs b/rust/bin/agent/src/handler/index.rs
new file mode 100644
index 0000000000..5f3aff30c7
--- /dev/null
+++ b/rust/bin/agent/src/handler/index.rs
@@ -0,0 +1,64 @@
+//
+// Copyright (C) 2019-2024 vdaas.org vald team
+//
+// 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
+//
+// https://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.
+//
+use proto::{
+ core::v1::agent_server,
+ payload::v1::{control, info, object, Empty},
+ vald::v1::index_server,
+};
+
+#[tonic::async_trait]
+impl agent_server::Agent for super::Agent {
+ async fn create_index(
+ &self,
+ request: tonic::Request,
+ ) -> std::result::Result, tonic::Status> {
+ todo!()
+ }
+
+ async fn save_index(
+ &self,
+ request: tonic::Request,
+ ) -> std::result::Result, tonic::Status> {
+ todo!()
+ }
+
+ #[doc = " Represent the creating and saving index RPC.\n"]
+ async fn create_and_save_index(
+ &self,
+ request: tonic::Request,
+ ) -> std::result::Result, tonic::Status> {
+ todo!()
+ }
+}
+
+#[tonic::async_trait]
+impl index_server::Index for super::Agent {
+ #[doc = " Represent the RPC to get the agent index information.\n"]
+ async fn index_info(
+ &self,
+ request: tonic::Request,
+ ) -> std::result::Result, tonic::Status> {
+ todo!()
+ }
+
+ #[doc = " Represent the RPC to get the agent index detailed information.\n"]
+ async fn index_detail(
+ &self,
+ request: tonic::Request,
+ ) -> std::result::Result, tonic::Status> {
+ todo!()
+ }
+}
diff --git a/rust/libs/proto/src/core.v1.tonic.rs b/rust/libs/proto/src/core.v1.tonic.rs
index ba50ab8380..b021552c00 100644
--- a/rust/libs/proto/src/core.v1.tonic.rs
+++ b/rust/libs/proto/src/core.v1.tonic.rs
@@ -123,6 +123,8 @@ pub mod agent_client {
req.extensions_mut().insert(GrpcMethod::new("core.v1.Agent", "CreateIndex"));
self.inner.unary(req, path, codec).await
}
+ /** Represent the saving index RPC.
+*/
pub async fn save_index(
&mut self,
request: impl tonic::IntoRequest,
@@ -174,59 +176,6 @@ pub mod agent_client {
.insert(GrpcMethod::new("core.v1.Agent", "CreateAndSaveIndex"));
self.inner.unary(req, path, codec).await
}
- /** Represent the RPC to get the agent index information.
-*/
- pub async fn index_info(
- &mut self,
- request: impl tonic::IntoRequest,
- ) -> std::result::Result<
- tonic::Response,
- tonic::Status,
- > {
- self.inner
- .ready()
- .await
- .map_err(|e| {
- tonic::Status::new(
- tonic::Code::Unknown,
- format!("Service was not ready: {}", e.into()),
- )
- })?;
- let codec = tonic::codec::ProstCodec::default();
- let path = http::uri::PathAndQuery::from_static("/core.v1.Agent/IndexInfo");
- let mut req = request.into_request();
- req.extensions_mut().insert(GrpcMethod::new("core.v1.Agent", "IndexInfo"));
- self.inner.unary(req, path, codec).await
- }
- /** Represent the RPC to get the vector metadata. This RPC is mainly used for index correction process
-*/
- pub async fn get_timestamp(
- &mut self,
- request: impl tonic::IntoRequest<
- super::super::super::payload::v1::object::GetTimestampRequest,
- >,
- ) -> std::result::Result<
- tonic::Response,
- tonic::Status,
- > {
- self.inner
- .ready()
- .await
- .map_err(|e| {
- tonic::Status::new(
- tonic::Code::Unknown,
- format!("Service was not ready: {}", e.into()),
- )
- })?;
- let codec = tonic::codec::ProstCodec::default();
- let path = http::uri::PathAndQuery::from_static(
- "/core.v1.Agent/GetTimestamp",
- );
- let mut req = request.into_request();
- req.extensions_mut()
- .insert(GrpcMethod::new("core.v1.Agent", "GetTimestamp"));
- self.inner.unary(req, path, codec).await
- }
}
}
/// Generated server implementations.
@@ -245,6 +194,8 @@ pub mod agent_server {
tonic::Response,
tonic::Status,
>;
+ /** Represent the saving index RPC.
+*/
async fn save_index(
&self,
request: tonic::Request,
@@ -263,26 +214,6 @@ pub mod agent_server {
tonic::Response,
tonic::Status,
>;
- /** Represent the RPC to get the agent index information.
-*/
- async fn index_info(
- &self,
- request: tonic::Request,
- ) -> std::result::Result<
- tonic::Response,
- tonic::Status,
- >;
- /** Represent the RPC to get the vector metadata. This RPC is mainly used for index correction process
-*/
- async fn get_timestamp(
- &self,
- request: tonic::Request<
- super::super::super::payload::v1::object::GetTimestampRequest,
- >,
- ) -> std::result::Result<
- tonic::Response,
- tonic::Status,
- >;
}
#[derive(Debug)]
pub struct AgentServer {
@@ -510,104 +441,6 @@ pub mod agent_server {
};
Box::pin(fut)
}
- "/core.v1.Agent/IndexInfo" => {
- #[allow(non_camel_case_types)]
- struct IndexInfoSvc(pub Arc);
- impl<
- T: Agent,
- > tonic::server::UnaryService<
- super::super::super::payload::v1::Empty,
- > for IndexInfoSvc {
- type Response = super::super::super::payload::v1::info::index::Count;
- type Future = BoxFuture<
- tonic::Response,
- tonic::Status,
- >;
- fn call(
- &mut self,
- request: tonic::Request<
- super::super::super::payload::v1::Empty,
- >,
- ) -> Self::Future {
- let inner = Arc::clone(&self.0);
- let fut = async move {
- ::index_info(&inner, request).await
- };
- Box::pin(fut)
- }
- }
- let accept_compression_encodings = self.accept_compression_encodings;
- let send_compression_encodings = self.send_compression_encodings;
- let max_decoding_message_size = self.max_decoding_message_size;
- let max_encoding_message_size = self.max_encoding_message_size;
- let inner = self.inner.clone();
- let fut = async move {
- let inner = inner.0;
- let method = IndexInfoSvc(inner);
- let codec = tonic::codec::ProstCodec::default();
- let mut grpc = tonic::server::Grpc::new(codec)
- .apply_compression_config(
- accept_compression_encodings,
- send_compression_encodings,
- )
- .apply_max_message_size_config(
- max_decoding_message_size,
- max_encoding_message_size,
- );
- let res = grpc.unary(method, req).await;
- Ok(res)
- };
- Box::pin(fut)
- }
- "/core.v1.Agent/GetTimestamp" => {
- #[allow(non_camel_case_types)]
- struct GetTimestampSvc(pub Arc);
- impl<
- T: Agent,
- > tonic::server::UnaryService<
- super::super::super::payload::v1::object::GetTimestampRequest,
- > for GetTimestampSvc {
- type Response = super::super::super::payload::v1::object::Timestamp;
- type Future = BoxFuture<
- tonic::Response,
- tonic::Status,
- >;
- fn call(
- &mut self,
- request: tonic::Request<
- super::super::super::payload::v1::object::GetTimestampRequest,
- >,
- ) -> Self::Future {
- let inner = Arc::clone(&self.0);
- let fut = async move {
- ::get_timestamp(&inner, request).await
- };
- Box::pin(fut)
- }
- }
- let accept_compression_encodings = self.accept_compression_encodings;
- let send_compression_encodings = self.send_compression_encodings;
- let max_decoding_message_size = self.max_decoding_message_size;
- let max_encoding_message_size = self.max_encoding_message_size;
- let inner = self.inner.clone();
- let fut = async move {
- let inner = inner.0;
- let method = GetTimestampSvc(inner);
- let codec = tonic::codec::ProstCodec::default();
- let mut grpc = tonic::server::Grpc::new(codec)
- .apply_compression_config(
- accept_compression_encodings,
- send_compression_encodings,
- )
- .apply_max_message_size_config(
- max_decoding_message_size,
- max_encoding_message_size,
- );
- let res = grpc.unary(method, req).await;
- Ok(res)
- };
- Box::pin(fut)
- }
_ => {
Box::pin(async move {
Ok(
diff --git a/rust/libs/proto/src/manager.index.v1.rs b/rust/libs/proto/src/manager.index.v1.rs
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/rust/libs/proto/src/manager.index.v1.tonic.rs b/rust/libs/proto/src/manager.index.v1.tonic.rs
deleted file mode 100644
index 84255cb3a5..0000000000
--- a/rust/libs/proto/src/manager.index.v1.tonic.rs
+++ /dev/null
@@ -1,312 +0,0 @@
-//
-// Copyright (C) 2019-2024 vdaas.org vald team
-//
-// 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
-//
-// https://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.
-//
-pub mod index_client {
- #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
- use tonic::codegen::*;
- use tonic::codegen::http::Uri;
- #[derive(Debug, Clone)]
- pub struct IndexClient {
- inner: tonic::client::Grpc,
- }
- impl IndexClient {
- /// Attempt to create a new client by connecting to a given endpoint.
- pub async fn connect(dst: D) -> Result
- where
- D: TryInto,
- D::Error: Into,
- {
- let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
- Ok(Self::new(conn))
- }
- }
- impl IndexClient
- where
- T: tonic::client::GrpcService,
- T::Error: Into,
- T::ResponseBody: Body + Send + 'static,
- ::Error: Into + Send,
- {
- pub fn new(inner: T) -> Self {
- let inner = tonic::client::Grpc::new(inner);
- Self { inner }
- }
- pub fn with_origin(inner: T, origin: Uri) -> Self {
- let inner = tonic::client::Grpc::with_origin(inner, origin);
- Self { inner }
- }
- pub fn with_interceptor(
- inner: T,
- interceptor: F,
- ) -> IndexClient>
- where
- F: tonic::service::Interceptor,
- T::ResponseBody: Default,
- T: tonic::codegen::Service<
- http::Request,
- Response = http::Response<
- >::ResponseBody,
- >,
- >,
- ,
- >>::Error: Into + Send + Sync,
- {
- IndexClient::new(InterceptedService::new(inner, interceptor))
- }
- /// Compress requests with the given encoding.
- ///
- /// This requires the server to support it otherwise it might respond with an
- /// error.
- #[must_use]
- pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
- self.inner = self.inner.send_compressed(encoding);
- self
- }
- /// Enable decompressing responses.
- #[must_use]
- pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
- self.inner = self.inner.accept_compressed(encoding);
- self
- }
- /// Limits the maximum size of a decoded message.
- ///
- /// Default: `4MB`
- #[must_use]
- pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
- self.inner = self.inner.max_decoding_message_size(limit);
- self
- }
- /// Limits the maximum size of an encoded message.
- ///
- /// Default: `usize::MAX`
- #[must_use]
- pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
- self.inner = self.inner.max_encoding_message_size(limit);
- self
- }
- pub async fn index_info(
- &mut self,
- request: impl tonic::IntoRequest<
- super::super::super::super::payload::v1::Empty,
- >,
- ) -> std::result::Result<
- tonic::Response,
- tonic::Status,
- > {
- self.inner
- .ready()
- .await
- .map_err(|e| {
- tonic::Status::new(
- tonic::Code::Unknown,
- format!("Service was not ready: {}", e.into()),
- )
- })?;
- let codec = tonic::codec::ProstCodec::default();
- let path = http::uri::PathAndQuery::from_static(
- "/manager.index.v1.Index/IndexInfo",
- );
- let mut req = request.into_request();
- req.extensions_mut()
- .insert(GrpcMethod::new("manager.index.v1.Index", "IndexInfo"));
- self.inner.unary(req, path, codec).await
- }
- }
-}
-/// Generated server implementations.
-pub mod index_server {
- #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
- use tonic::codegen::*;
- /// Generated trait containing gRPC methods that should be implemented for use with IndexServer.
- #[async_trait]
- pub trait Index: Send + Sync + 'static {
- async fn index_info(
- &self,
- request: tonic::Request,
- ) -> std::result::Result<
- tonic::Response,
- tonic::Status,
- >;
- }
- #[derive(Debug)]
- pub struct IndexServer {
- inner: _Inner,
- accept_compression_encodings: EnabledCompressionEncodings,
- send_compression_encodings: EnabledCompressionEncodings,
- max_decoding_message_size: Option,
- max_encoding_message_size: Option,
- }
- struct _Inner(Arc);
- impl IndexServer {
- pub fn new(inner: T) -> Self {
- Self::from_arc(Arc::new(inner))
- }
- pub fn from_arc(inner: Arc) -> Self {
- let inner = _Inner(inner);
- Self {
- inner,
- accept_compression_encodings: Default::default(),
- send_compression_encodings: Default::default(),
- max_decoding_message_size: None,
- max_encoding_message_size: None,
- }
- }
- pub fn with_interceptor(
- inner: T,
- interceptor: F,
- ) -> InterceptedService
- where
- F: tonic::service::Interceptor,
- {
- InterceptedService::new(Self::new(inner), interceptor)
- }
- /// Enable decompressing requests with the given encoding.
- #[must_use]
- pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
- self.accept_compression_encodings.enable(encoding);
- self
- }
- /// Compress responses with the given encoding, if the client supports it.
- #[must_use]
- pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
- self.send_compression_encodings.enable(encoding);
- self
- }
- /// Limits the maximum size of a decoded message.
- ///
- /// Default: `4MB`
- #[must_use]
- pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
- self.max_decoding_message_size = Some(limit);
- self
- }
- /// Limits the maximum size of an encoded message.
- ///
- /// Default: `usize::MAX`
- #[must_use]
- pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
- self.max_encoding_message_size = Some(limit);
- self
- }
- }
- impl tonic::codegen::Service> for IndexServer
- where
- T: Index,
- B: Body + Send + 'static,
- B::Error: Into + Send + 'static,
- {
- type Response = http::Response;
- type Error = std::convert::Infallible;
- type Future = BoxFuture;
- fn poll_ready(
- &mut self,
- _cx: &mut Context<'_>,
- ) -> Poll> {
- Poll::Ready(Ok(()))
- }
- fn call(&mut self, req: http::Request) -> Self::Future {
- let inner = self.inner.clone();
- match req.uri().path() {
- "/manager.index.v1.Index/IndexInfo" => {
- #[allow(non_camel_case_types)]
- struct IndexInfoSvc(pub Arc);
- impl<
- T: Index,
- > tonic::server::UnaryService<
- super::super::super::super::payload::v1::Empty,
- > for IndexInfoSvc {
- type Response = super::super::super::super::payload::v1::info::index::Count;
- type Future = BoxFuture<
- tonic::Response,
- tonic::Status,
- >;
- fn call(
- &mut self,
- request: tonic::Request<
- super::super::super::super::payload::v1::Empty,
- >,
- ) -> Self::Future {
- let inner = Arc::clone(&self.0);
- let fut = async move {
- ::index_info(&inner, request).await
- };
- Box::pin(fut)
- }
- }
- let accept_compression_encodings = self.accept_compression_encodings;
- let send_compression_encodings = self.send_compression_encodings;
- let max_decoding_message_size = self.max_decoding_message_size;
- let max_encoding_message_size = self.max_encoding_message_size;
- let inner = self.inner.clone();
- let fut = async move {
- let inner = inner.0;
- let method = IndexInfoSvc(inner);
- let codec = tonic::codec::ProstCodec::default();
- let mut grpc = tonic::server::Grpc::new(codec)
- .apply_compression_config(
- accept_compression_encodings,
- send_compression_encodings,
- )
- .apply_max_message_size_config(
- max_decoding_message_size,
- max_encoding_message_size,
- );
- let res = grpc.unary(method, req).await;
- Ok(res)
- };
- Box::pin(fut)
- }
- _ => {
- Box::pin(async move {
- Ok(
- http::Response::builder()
- .status(200)
- .header("grpc-status", "12")
- .header("content-type", "application/grpc")
- .body(empty_body())
- .unwrap(),
- )
- })
- }
- }
- }
- }
- impl Clone for IndexServer {
- fn clone(&self) -> Self {
- let inner = self.inner.clone();
- Self {
- inner,
- accept_compression_encodings: self.accept_compression_encodings,
- send_compression_encodings: self.send_compression_encodings,
- max_decoding_message_size: self.max_decoding_message_size,
- max_encoding_message_size: self.max_encoding_message_size,
- }
- }
- }
- impl Clone for _Inner {
- fn clone(&self) -> Self {
- Self(Arc::clone(&self.0))
- }
- }
- impl std::fmt::Debug for _Inner {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- write!(f, "{:?}", self.0)
- }
- }
- impl tonic::server::NamedService for IndexServer {
- const NAME: &'static str = "manager.index.v1.Index";
- }
-}
diff --git a/rust/libs/proto/src/payload.v1.rs b/rust/libs/proto/src/payload.v1.rs
index 25051403a4..8b67f0a033 100644
--- a/rust/libs/proto/src/payload.v1.rs
+++ b/rust/libs/proto/src/payload.v1.rs
@@ -611,7 +611,7 @@ pub mod object {
/// Represent a request to fetch vector meta data.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
- pub struct GetTimestampRequest {
+ pub struct TimestampRequest {
/// The vector ID to be fetched.
#[prost(message, optional, tag="1")]
pub id: ::core::option::Option,
@@ -838,6 +838,20 @@ pub mod info {
#[prost(bool, tag="4")]
pub saving: bool,
}
+ /// Represent the index count for each Agents message.
+ #[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+ pub struct Detail {
+ /// count infos for each agents
+ #[prost(map="string, message", tag="1")]
+ pub counts: ::std::collections::HashMap<::prost::alloc::string::String, Count>,
+ /// index replica of vald cluster
+ #[prost(uint32, tag="2")]
+ pub replica: u32,
+ /// live agent replica of vald cluster
+ #[prost(uint32, tag="3")]
+ pub live_agents: u32,
+ }
/// Represent the UUID message.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
diff --git a/rust/libs/proto/src/vald.v1.tonic.rs b/rust/libs/proto/src/vald.v1.tonic.rs
index 32d1d10e7b..21f5bbe951 100644
--- a/rust/libs/proto/src/vald.v1.tonic.rs
+++ b/rust/libs/proto/src/vald.v1.tonic.rs
@@ -1651,6 +1651,391 @@ pub mod flush_server {
}
}
/// Generated client implementations.
+pub mod index_client {
+ #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
+ use tonic::codegen::*;
+ use tonic::codegen::http::Uri;
+ /** Represent the index manager service.
+*/
+ #[derive(Debug, Clone)]
+ pub struct IndexClient {
+ inner: tonic::client::Grpc,
+ }
+ impl IndexClient {
+ /// Attempt to create a new client by connecting to a given endpoint.
+ pub async fn connect(dst: D) -> Result
+ where
+ D: TryInto,
+ D::Error: Into,
+ {
+ let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
+ Ok(Self::new(conn))
+ }
+ }
+ impl IndexClient
+ where
+ T: tonic::client::GrpcService,
+ T::Error: Into,
+ T::ResponseBody: Body + Send + 'static,
+ ::Error: Into + Send,
+ {
+ pub fn new(inner: T) -> Self {
+ let inner = tonic::client::Grpc::new(inner);
+ Self { inner }
+ }
+ pub fn with_origin(inner: T, origin: Uri) -> Self {
+ let inner = tonic::client::Grpc::with_origin(inner, origin);
+ Self { inner }
+ }
+ pub fn with_interceptor(
+ inner: T,
+ interceptor: F,
+ ) -> IndexClient>
+ where
+ F: tonic::service::Interceptor,
+ T::ResponseBody: Default,
+ T: tonic::codegen::Service<
+ http::Request,
+ Response = http::Response<
+ >::ResponseBody,
+ >,
+ >,
+ ,
+ >>::Error: Into + Send + Sync,
+ {
+ IndexClient::new(InterceptedService::new(inner, interceptor))
+ }
+ /// Compress requests with the given encoding.
+ ///
+ /// This requires the server to support it otherwise it might respond with an
+ /// error.
+ #[must_use]
+ pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
+ self.inner = self.inner.send_compressed(encoding);
+ self
+ }
+ /// Enable decompressing responses.
+ #[must_use]
+ pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
+ self.inner = self.inner.accept_compressed(encoding);
+ self
+ }
+ /// Limits the maximum size of a decoded message.
+ ///
+ /// Default: `4MB`
+ #[must_use]
+ pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
+ self.inner = self.inner.max_decoding_message_size(limit);
+ self
+ }
+ /// Limits the maximum size of an encoded message.
+ ///
+ /// Default: `usize::MAX`
+ #[must_use]
+ pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
+ self.inner = self.inner.max_encoding_message_size(limit);
+ self
+ }
+ /** Represent the RPC to get the index information.
+*/
+ pub async fn index_info(
+ &mut self,
+ request: impl tonic::IntoRequest,
+ ) -> std::result::Result<
+ tonic::Response,
+ tonic::Status,
+ > {
+ self.inner
+ .ready()
+ .await
+ .map_err(|e| {
+ tonic::Status::new(
+ tonic::Code::Unknown,
+ format!("Service was not ready: {}", e.into()),
+ )
+ })?;
+ let codec = tonic::codec::ProstCodec::default();
+ let path = http::uri::PathAndQuery::from_static("/vald.v1.Index/IndexInfo");
+ let mut req = request.into_request();
+ req.extensions_mut().insert(GrpcMethod::new("vald.v1.Index", "IndexInfo"));
+ self.inner.unary(req, path, codec).await
+ }
+ /** Represent the RPC to get the index information for each agents.
+*/
+ pub async fn index_detail(
+ &mut self,
+ request: impl tonic::IntoRequest,
+ ) -> std::result::Result<
+ tonic::Response,
+ tonic::Status,
+ > {
+ self.inner
+ .ready()
+ .await
+ .map_err(|e| {
+ tonic::Status::new(
+ tonic::Code::Unknown,
+ format!("Service was not ready: {}", e.into()),
+ )
+ })?;
+ let codec = tonic::codec::ProstCodec::default();
+ let path = http::uri::PathAndQuery::from_static(
+ "/vald.v1.Index/IndexDetail",
+ );
+ let mut req = request.into_request();
+ req.extensions_mut().insert(GrpcMethod::new("vald.v1.Index", "IndexDetail"));
+ self.inner.unary(req, path, codec).await
+ }
+ }
+}
+/// Generated server implementations.
+pub mod index_server {
+ #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
+ use tonic::codegen::*;
+ /// Generated trait containing gRPC methods that should be implemented for use with IndexServer.
+ #[async_trait]
+ pub trait Index: Send + Sync + 'static {
+ /** Represent the RPC to get the index information.
+*/
+ async fn index_info(
+ &self,
+ request: tonic::Request,
+ ) -> std::result::Result<
+ tonic::Response,
+ tonic::Status,
+ >;
+ /** Represent the RPC to get the index information for each agents.
+*/
+ async fn index_detail(
+ &self,
+ request: tonic::Request,
+ ) -> std::result::Result<
+ tonic::Response,
+ tonic::Status,
+ >;
+ }
+ /** Represent the index manager service.
+*/
+ #[derive(Debug)]
+ pub struct IndexServer {
+ inner: _Inner,
+ accept_compression_encodings: EnabledCompressionEncodings,
+ send_compression_encodings: EnabledCompressionEncodings,
+ max_decoding_message_size: Option,
+ max_encoding_message_size: Option,
+ }
+ struct _Inner(Arc);
+ impl IndexServer {
+ pub fn new(inner: T) -> Self {
+ Self::from_arc(Arc::new(inner))
+ }
+ pub fn from_arc(inner: Arc) -> Self {
+ let inner = _Inner(inner);
+ Self {
+ inner,
+ accept_compression_encodings: Default::default(),
+ send_compression_encodings: Default::default(),
+ max_decoding_message_size: None,
+ max_encoding_message_size: None,
+ }
+ }
+ pub fn with_interceptor(
+ inner: T,
+ interceptor: F,
+ ) -> InterceptedService
+ where
+ F: tonic::service::Interceptor,
+ {
+ InterceptedService::new(Self::new(inner), interceptor)
+ }
+ /// Enable decompressing requests with the given encoding.
+ #[must_use]
+ pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
+ self.accept_compression_encodings.enable(encoding);
+ self
+ }
+ /// Compress responses with the given encoding, if the client supports it.
+ #[must_use]
+ pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
+ self.send_compression_encodings.enable(encoding);
+ self
+ }
+ /// Limits the maximum size of a decoded message.
+ ///
+ /// Default: `4MB`
+ #[must_use]
+ pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
+ self.max_decoding_message_size = Some(limit);
+ self
+ }
+ /// Limits the maximum size of an encoded message.
+ ///
+ /// Default: `usize::MAX`
+ #[must_use]
+ pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
+ self.max_encoding_message_size = Some(limit);
+ self
+ }
+ }
+ impl tonic::codegen::Service> for IndexServer
+ where
+ T: Index,
+ B: Body + Send + 'static,
+ B::Error: Into + Send + 'static,
+ {
+ type Response = http::Response;
+ type Error = std::convert::Infallible;
+ type Future = BoxFuture;
+ fn poll_ready(
+ &mut self,
+ _cx: &mut Context<'_>,
+ ) -> Poll> {
+ Poll::Ready(Ok(()))
+ }
+ fn call(&mut self, req: http::Request) -> Self::Future {
+ let inner = self.inner.clone();
+ match req.uri().path() {
+ "/vald.v1.Index/IndexInfo" => {
+ #[allow(non_camel_case_types)]
+ struct IndexInfoSvc(pub Arc);
+ impl<
+ T: Index,
+ > tonic::server::UnaryService<
+ super::super::super::payload::v1::Empty,
+ > for IndexInfoSvc {
+ type Response = super::super::super::payload::v1::info::index::Count;
+ type Future = BoxFuture<
+ tonic::Response,
+ tonic::Status,
+ >;
+ fn call(
+ &mut self,
+ request: tonic::Request<
+ super::super::super::payload::v1::Empty,
+ >,
+ ) -> Self::Future {
+ let inner = Arc::clone(&self.0);
+ let fut = async move {
+ ::index_info(&inner, request).await
+ };
+ Box::pin(fut)
+ }
+ }
+ let accept_compression_encodings = self.accept_compression_encodings;
+ let send_compression_encodings = self.send_compression_encodings;
+ let max_decoding_message_size = self.max_decoding_message_size;
+ let max_encoding_message_size = self.max_encoding_message_size;
+ let inner = self.inner.clone();
+ let fut = async move {
+ let inner = inner.0;
+ let method = IndexInfoSvc(inner);
+ let codec = tonic::codec::ProstCodec::default();
+ let mut grpc = tonic::server::Grpc::new(codec)
+ .apply_compression_config(
+ accept_compression_encodings,
+ send_compression_encodings,
+ )
+ .apply_max_message_size_config(
+ max_decoding_message_size,
+ max_encoding_message_size,
+ );
+ let res = grpc.unary(method, req).await;
+ Ok(res)
+ };
+ Box::pin(fut)
+ }
+ "/vald.v1.Index/IndexDetail" => {
+ #[allow(non_camel_case_types)]
+ struct IndexDetailSvc(pub Arc);
+ impl<
+ T: Index,
+ > tonic::server::UnaryService<
+ super::super::super::payload::v1::Empty,
+ > for IndexDetailSvc {
+ type Response = super::super::super::payload::v1::info::index::Detail;
+ type Future = BoxFuture<
+ tonic::Response,
+ tonic::Status,
+ >;
+ fn call(
+ &mut self,
+ request: tonic::Request<
+ super::super::super::payload::v1::Empty,
+ >,
+ ) -> Self::Future {
+ let inner = Arc::clone(&self.0);
+ let fut = async move {
+ ::index_detail(&inner, request).await
+ };
+ Box::pin(fut)
+ }
+ }
+ let accept_compression_encodings = self.accept_compression_encodings;
+ let send_compression_encodings = self.send_compression_encodings;
+ let max_decoding_message_size = self.max_decoding_message_size;
+ let max_encoding_message_size = self.max_encoding_message_size;
+ let inner = self.inner.clone();
+ let fut = async move {
+ let inner = inner.0;
+ let method = IndexDetailSvc(inner);
+ let codec = tonic::codec::ProstCodec::default();
+ let mut grpc = tonic::server::Grpc::new(codec)
+ .apply_compression_config(
+ accept_compression_encodings,
+ send_compression_encodings,
+ )
+ .apply_max_message_size_config(
+ max_decoding_message_size,
+ max_encoding_message_size,
+ );
+ let res = grpc.unary(method, req).await;
+ Ok(res)
+ };
+ Box::pin(fut)
+ }
+ _ => {
+ Box::pin(async move {
+ Ok(
+ http::Response::builder()
+ .status(200)
+ .header("grpc-status", "12")
+ .header("content-type", "application/grpc")
+ .body(empty_body())
+ .unwrap(),
+ )
+ })
+ }
+ }
+ }
+ }
+ impl Clone for IndexServer {
+ fn clone(&self) -> Self {
+ let inner = self.inner.clone();
+ Self {
+ inner,
+ accept_compression_encodings: self.accept_compression_encodings,
+ send_compression_encodings: self.send_compression_encodings,
+ max_decoding_message_size: self.max_decoding_message_size,
+ max_encoding_message_size: self.max_encoding_message_size,
+ }
+ }
+ }
+ impl Clone for _Inner {
+ fn clone(&self) -> Self {
+ Self(Arc::clone(&self.0))
+ }
+ }
+ impl std::fmt::Debug for _Inner {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ write!(f, "{:?}", self.0)
+ }
+ }
+ impl tonic::server::NamedService for IndexServer {
+ const NAME: &'static str = "vald.v1.Index";
+ }
+}
+/// Generated client implementations.
pub mod insert_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
@@ -2248,8 +2633,6 @@ pub mod object_client {
req.extensions_mut().insert(GrpcMethod::new("vald.v1.Object", "Exists"));
self.inner.unary(req, path, codec).await
}
- /** A method to fetch a vector.
-*/
pub async fn get_object(
&mut self,
request: impl tonic::IntoRequest<
@@ -2340,6 +2723,35 @@ pub mod object_client {
.insert(GrpcMethod::new("vald.v1.Object", "StreamListObject"));
self.inner.server_streaming(req, path, codec).await
}
+ /** Represent the RPC to get the vector metadata. This RPC is mainly used for index correction process
+*/
+ pub async fn get_timestamp(
+ &mut self,
+ request: impl tonic::IntoRequest<
+ super::super::super::payload::v1::object::TimestampRequest,
+ >,
+ ) -> std::result::Result<
+ tonic::Response,
+ tonic::Status,
+ > {
+ self.inner
+ .ready()
+ .await
+ .map_err(|e| {
+ tonic::Status::new(
+ tonic::Code::Unknown,
+ format!("Service was not ready: {}", e.into()),
+ )
+ })?;
+ let codec = tonic::codec::ProstCodec::default();
+ let path = http::uri::PathAndQuery::from_static(
+ "/vald.v1.Object/GetTimestamp",
+ );
+ let mut req = request.into_request();
+ req.extensions_mut()
+ .insert(GrpcMethod::new("vald.v1.Object", "GetTimestamp"));
+ self.inner.unary(req, path, codec).await
+ }
}
}
/// Generated server implementations.
@@ -2356,8 +2768,6 @@ pub mod object_server {
tonic::Response,
tonic::Status,
>;
- /** A method to fetch a vector.
-*/
async fn get_object(
&self,
request: tonic::Request<
@@ -2407,6 +2817,17 @@ pub mod object_server {
tonic::Response,
tonic::Status,
>;
+ /** Represent the RPC to get the vector metadata. This RPC is mainly used for index correction process
+*/
+ async fn get_timestamp(
+ &self,
+ request: tonic::Request<
+ super::super::super::payload::v1::object::TimestampRequest,
+ >,
+ ) -> std::result::Result<
+ tonic::Response,
+ tonic::Status,
+ >;
}
#[derive(Debug)]
pub struct ObjectServer {
@@ -2687,6 +3108,55 @@ pub mod object_server {
};
Box::pin(fut)
}
+ "/vald.v1.Object/GetTimestamp" => {
+ #[allow(non_camel_case_types)]
+ struct GetTimestampSvc(pub Arc);
+ impl<
+ T: Object,
+ > tonic::server::UnaryService<
+ super::super::super::payload::v1::object::TimestampRequest,
+ > for GetTimestampSvc {
+ type Response = super::super::super::payload::v1::object::Timestamp;
+ type Future = BoxFuture<
+ tonic::Response,
+ tonic::Status,
+ >;
+ fn call(
+ &mut self,
+ request: tonic::Request<
+ super::super::super::payload::v1::object::TimestampRequest,
+ >,
+ ) -> Self::Future {
+ let inner = Arc::clone(&self.0);
+ let fut = async move {
+ ::get_timestamp(&inner, request).await
+ };
+ Box::pin(fut)
+ }
+ }
+ let accept_compression_encodings = self.accept_compression_encodings;
+ let send_compression_encodings = self.send_compression_encodings;
+ let max_decoding_message_size = self.max_decoding_message_size;
+ let max_encoding_message_size = self.max_encoding_message_size;
+ let inner = self.inner.clone();
+ let fut = async move {
+ let inner = inner.0;
+ let method = GetTimestampSvc(inner);
+ let codec = tonic::codec::ProstCodec::default();
+ let mut grpc = tonic::server::Grpc::new(codec)
+ .apply_compression_config(
+ accept_compression_encodings,
+ send_compression_encodings,
+ )
+ .apply_max_message_size_config(
+ max_decoding_message_size,
+ max_encoding_message_size,
+ );
+ let res = grpc.unary(method, req).await;
+ Ok(res)
+ };
+ Box::pin(fut)
+ }
_ => {
Box::pin(async move {
Ok(
diff --git a/tests/e2e/hdf5/hdf5.go b/tests/e2e/hdf5/hdf5.go
index 4ebd9c0cb4..3a8745c244 100644
--- a/tests/e2e/hdf5/hdf5.go
+++ b/tests/e2e/hdf5/hdf5.go
@@ -19,9 +19,7 @@
// package hdf5 provides hdf5 utilities for e2e testing
package hdf5
-import (
- "gonum.org/v1/hdf5"
-)
+import "gonum.org/v1/hdf5"
type Dataset struct {
Train [][]float32
diff --git a/tests/e2e/kubernetes/client/client.go b/tests/e2e/kubernetes/client/client.go
index e97aba2d01..60d1441ed8 100644
--- a/tests/e2e/kubernetes/client/client.go
+++ b/tests/e2e/kubernetes/client/client.go
@@ -102,15 +102,12 @@ func New(kubeConfig string) (Client, error) {
}
func (cli *client) Portforward(
- namespace, podName string,
- localPort, podPort int,
+ namespace, podName string, localPort, podPort int,
) *portforward.Portforward {
return portforward.New(cli.rest, namespace, podName, localPort, podPort)
}
-func (cli *client) GetPod(
- ctx context.Context,
- namespace,
+func (cli *client) GetPod(ctx context.Context, namespace,
name string,
) (*corev1.Pod, error) {
pod, err := cli.clientset.CoreV1().Pods(
@@ -123,9 +120,7 @@ func (cli *client) GetPod(
}
func (cli *client) GetPods(
- ctx context.Context,
- namespace string,
- labelSelector string,
+ ctx context.Context, namespace string, labelSelector string,
) ([]corev1.Pod, error) {
pods, err := cli.clientset.CoreV1().Pods(
namespace,
@@ -139,10 +134,7 @@ func (cli *client) GetPods(
return pods.Items, nil
}
-func (cli *client) DeletePod(
- ctx context.Context,
- namespace, name string,
-) error {
+func (cli *client) DeletePod(ctx context.Context, namespace, name string) error {
cli.clientset.CoreV1().Pods(
namespace,
).Delete(ctx, name, metav1.DeleteOptions{})
@@ -151,9 +143,7 @@ func (cli *client) DeletePod(
}
func (cli *client) WaitForPodReady(
- ctx context.Context,
- namespace, name string,
- timeout time.Duration,
+ ctx context.Context, namespace, name string, timeout time.Duration,
) (ok bool, err error) {
ctx, cancel := context.WithTimeout(ctx, timeout)
defer cancel()
@@ -184,7 +174,9 @@ func (cli *client) WaitForPodReady(
}
}
-func (cli *client) ListCronJob(ctx context.Context, namespace, labelSelector string) ([]v1.CronJob, error) {
+func (cli *client) ListCronJob(
+ ctx context.Context, namespace, labelSelector string,
+) ([]v1.CronJob, error) {
cronJobs, err := cli.clientset.BatchV1().CronJobs(namespace).List(ctx, metav1.ListOptions{
LabelSelector: labelSelector,
})
@@ -195,7 +187,9 @@ func (cli *client) ListCronJob(ctx context.Context, namespace, labelSelector str
return cronJobs.Items, nil
}
-func (cli *client) CreateJobFromCronJob(ctx context.Context, name, namespace string, cronJob *v1.CronJob) error {
+func (cli *client) CreateJobFromCronJob(
+ ctx context.Context, name, namespace string, cronJob *v1.CronJob,
+) error {
job := &v1.Job{
ObjectMeta: metav1.ObjectMeta{
Name: name,
diff --git a/tests/e2e/kubernetes/kubectl/kubectl.go b/tests/e2e/kubernetes/kubectl/kubectl.go
index a09725a5f1..f50e396bfc 100644
--- a/tests/e2e/kubernetes/kubectl/kubectl.go
+++ b/tests/e2e/kubernetes/kubectl/kubectl.go
@@ -41,7 +41,9 @@ func RolloutResource(ctx context.Context, t *testing.T, resource string) error {
}
// WaitResources waits for multiple resources to be ready.
-func WaitResources(ctx context.Context, t *testing.T, resource, labelSelector, condition, timeout string) error {
+func WaitResources(
+ ctx context.Context, t *testing.T, resource, labelSelector, condition, timeout string,
+) error {
t.Helper()
cmd := exec.CommandContext(ctx, "kubectl", "wait", "--for=condition="+condition, "-l", labelSelector, "--timeout", timeout, resource)
diff --git a/tests/e2e/operation/job.go b/tests/e2e/operation/job.go
index d98bfeca53..2a9e2efbec 100644
--- a/tests/e2e/operation/job.go
+++ b/tests/e2e/operation/job.go
@@ -22,6 +22,22 @@ import (
"testing"
)
+type JobExecutor interface {
+ CreateAndWait(t *testing.T, ctx context.Context, jobName string) error
+}
+
+type cronJobExecute struct {
+ cronJob string
+}
+
+var _ JobExecutor = (*cronJobExecute)(nil)
+
+func NewCronJobExecutor(cronJob string) JobExecutor {
+ return &cronJobExecute{
+ cronJob: cronJob,
+ }
+}
+
func (j *cronJobExecute) CreateAndWait(t *testing.T, ctx context.Context, jobName string) error {
if err := createJob(t, jobName, j.cronJob); err != nil {
return err
diff --git a/tests/e2e/operation/operation.go b/tests/e2e/operation/operation.go
index 592b07a9c6..62e9a794d0 100644
--- a/tests/e2e/operation/operation.go
+++ b/tests/e2e/operation/operation.go
@@ -174,7 +174,7 @@ func (c *client) SaveIndex(t *testing.T, ctx context.Context) error {
}
func (c *client) IndexInfo(t *testing.T, ctx context.Context) (*payload.Info_Index_Count, error) {
- client, err := c.getAgentClient(ctx)
+ client, err := c.getClient(ctx)
if err != nil {
return nil, err
}
@@ -229,19 +229,3 @@ func (c *client) recall(results []string, neighbors []int) (recall float64) {
return recall / float64(len(neighbors))
}
-
-type JobExecutor interface {
- CreateAndWait(t *testing.T, ctx context.Context, jobName string) error
-}
-
-type cronJobExecute struct {
- cronJob string
-}
-
-var _ JobExecutor = (*cronJobExecute)(nil)
-
-func NewCronJobExecutor(cronJob string) JobExecutor {
- return &cronJobExecute{
- cronJob: cronJob,
- }
-}
diff --git a/tests/e2e/operation/stream.go b/tests/e2e/operation/stream.go
index dac182d975..f606c67f1a 100644
--- a/tests/e2e/operation/stream.go
+++ b/tests/e2e/operation/stream.go
@@ -1093,11 +1093,7 @@ func (c *client) Exists(t *testing.T, ctx context.Context, id string) error {
return nil
}
-func (c *client) GetObject(
- t *testing.T,
- ctx context.Context,
- ds Dataset,
-) (rerr error) {
+func (c *client) GetObject(t *testing.T, ctx context.Context, ds Dataset) (rerr error) {
t.Log("getObject operation started")
client, err := c.getClient(ctx)
@@ -1187,11 +1183,7 @@ func (c *client) GetObject(
return rerr
}
-func (c *client) StreamListObject(
- t *testing.T,
- ctx context.Context,
- ds Dataset,
-) error {
+func (c *client) StreamListObject(t *testing.T, ctx context.Context, ds Dataset) error {
t.Log("StreamListObject operation started")
client, err := c.getClient(ctx)
diff --git a/versions/GOLANGCILINT_VERSION b/versions/GOLANGCILINT_VERSION
index f399a6f2bc..be33d89791 100644
--- a/versions/GOLANGCILINT_VERSION
+++ b/versions/GOLANGCILINT_VERSION
@@ -1 +1 @@
-v1.58.0
+v1.59.1
diff --git a/versions/GO_VERSION b/versions/GO_VERSION
index 89144dbc38..da9594fd66 100644
--- a/versions/GO_VERSION
+++ b/versions/GO_VERSION
@@ -1 +1 @@
-1.22.3
+1.22.5
diff --git a/versions/HDF5_VERSION b/versions/HDF5_VERSION
index e459802679..85b169d0cb 100644
--- a/versions/HDF5_VERSION
+++ b/versions/HDF5_VERSION
@@ -1 +1 @@
-hdf5-1_14_3
+hdf5_1.14.4.3
diff --git a/versions/HELM_DOCS_VERSION b/versions/HELM_DOCS_VERSION
index b50dd27dd9..a4cc55716f 100644
--- a/versions/HELM_DOCS_VERSION
+++ b/versions/HELM_DOCS_VERSION
@@ -1 +1 @@
-1.13.1
+1.14.2
diff --git a/versions/HELM_VERSION b/versions/HELM_VERSION
index 362617ca87..de3e42fc29 100644
--- a/versions/HELM_VERSION
+++ b/versions/HELM_VERSION
@@ -1 +1 @@
-v3.14.4
+v3.15.3
diff --git a/versions/JAEGER_OPERATOR_VERSION b/versions/JAEGER_OPERATOR_VERSION
index 261d95596f..99aed793ad 100644
--- a/versions/JAEGER_OPERATOR_VERSION
+++ b/versions/JAEGER_OPERATOR_VERSION
@@ -1 +1 @@
-2.53.0
+2.54.0
diff --git a/versions/K3S_VERSION b/versions/K3S_VERSION
index 6e9db4b4bb..e777e8936c 100644
--- a/versions/K3S_VERSION
+++ b/versions/K3S_VERSION
@@ -1 +1 @@
-v1.29.4-k3s1
+v1.30.2-k3s2
diff --git a/versions/KIND_VERSION b/versions/KIND_VERSION
index 2157409059..ca222b7cf3 100644
--- a/versions/KIND_VERSION
+++ b/versions/KIND_VERSION
@@ -1 +1 @@
-0.22.0
+0.23.0
diff --git a/versions/KUBECTL_VERSION b/versions/KUBECTL_VERSION
index 3aceb49678..062a7525f1 100644
--- a/versions/KUBECTL_VERSION
+++ b/versions/KUBECTL_VERSION
@@ -1 +1 @@
-v1.30.0
\ No newline at end of file
+v1.30.3
\ No newline at end of file
diff --git a/versions/NGT_VERSION b/versions/NGT_VERSION
index c043eea776..585940699b 100644
--- a/versions/NGT_VERSION
+++ b/versions/NGT_VERSION
@@ -1 +1 @@
-2.2.1
+2.2.3
diff --git a/versions/OPERATOR_SDK_VERSION b/versions/OPERATOR_SDK_VERSION
index e51138b8af..2f2ce0df61 100644
--- a/versions/OPERATOR_SDK_VERSION
+++ b/versions/OPERATOR_SDK_VERSION
@@ -1 +1 @@
-v1.34
+v1.33
diff --git a/versions/PROMETHEUS_STACK_VERSION b/versions/PROMETHEUS_STACK_VERSION
index 18365ff7ad..d16771deca 100644
--- a/versions/PROMETHEUS_STACK_VERSION
+++ b/versions/PROMETHEUS_STACK_VERSION
@@ -1 +1 @@
-58.4.0
+61.3.2
diff --git a/versions/PROTOBUF_VERSION b/versions/PROTOBUF_VERSION
index dfa88c8ebb..40682b3dcc 100644
--- a/versions/PROTOBUF_VERSION
+++ b/versions/PROTOBUF_VERSION
@@ -1 +1 @@
-26.1
+27.2
diff --git a/versions/REVIEWDOG_VERSION b/versions/REVIEWDOG_VERSION
index 8acb5ca441..2c80271d5a 100644
--- a/versions/REVIEWDOG_VERSION
+++ b/versions/REVIEWDOG_VERSION
@@ -1 +1 @@
-v0.17.4
+v0.20.1
diff --git a/versions/TELEPRESENCE_VERSION b/versions/TELEPRESENCE_VERSION
index cf8690732f..b8e248f40b 100644
--- a/versions/TELEPRESENCE_VERSION
+++ b/versions/TELEPRESENCE_VERSION
@@ -1 +1 @@
-2.18.0
+2.19.1
diff --git a/versions/YQ_VERSION b/versions/YQ_VERSION
index ec877613c7..77b34ac509 100644
--- a/versions/YQ_VERSION
+++ b/versions/YQ_VERSION
@@ -1 +1 @@
-v4.43.1
+v4.44.2
diff --git a/versions/actions/ACTIONS_CHECKOUT b/versions/actions/ACTIONS_CHECKOUT
index a95f288444..9edf2a44f4 100644
--- a/versions/actions/ACTIONS_CHECKOUT
+++ b/versions/actions/ACTIONS_CHECKOUT
@@ -1 +1 @@
-4.1.4
+4.1.7
diff --git a/versions/actions/ACTIONS_DOWNLOAD_ARTIFACT b/versions/actions/ACTIONS_DOWNLOAD_ARTIFACT
index 9edf2a44f4..a7c00da34f 100644
--- a/versions/actions/ACTIONS_DOWNLOAD_ARTIFACT
+++ b/versions/actions/ACTIONS_DOWNLOAD_ARTIFACT
@@ -1 +1 @@
-4.1.7
+4.1.8
diff --git a/versions/actions/ACTIONS_SETUP_GO b/versions/actions/ACTIONS_SETUP_GO
index 6b244dcd69..a1ef0cae18 100644
--- a/versions/actions/ACTIONS_SETUP_GO
+++ b/versions/actions/ACTIONS_SETUP_GO
@@ -1 +1 @@
-5.0.1
+5.0.2
diff --git a/versions/actions/ACTIONS_SETUP_NODE b/versions/actions/ACTIONS_SETUP_NODE
index 4d54daddb6..c4e41f9459 100644
--- a/versions/actions/ACTIONS_SETUP_NODE
+++ b/versions/actions/ACTIONS_SETUP_NODE
@@ -1 +1 @@
-4.0.2
+4.0.3
diff --git a/versions/actions/ACTIONS_UPLOAD_ARTIFACT b/versions/actions/ACTIONS_UPLOAD_ARTIFACT
index e91d9be2a8..eda862a98c 100644
--- a/versions/actions/ACTIONS_UPLOAD_ARTIFACT
+++ b/versions/actions/ACTIONS_UPLOAD_ARTIFACT
@@ -1 +1 @@
-4.3.3
+4.3.4
diff --git a/versions/actions/CODECOV_CODECOV_ACTION b/versions/actions/CODECOV_CODECOV_ACTION
index f77856a6f1..a84947d6ff 100644
--- a/versions/actions/CODECOV_CODECOV_ACTION
+++ b/versions/actions/CODECOV_CODECOV_ACTION
@@ -1 +1 @@
-4.3.1
+4.5.0
diff --git a/versions/actions/DOCKER_LOGIN_ACTION b/versions/actions/DOCKER_LOGIN_ACTION
index fd2a01863f..15a2799817 100644
--- a/versions/actions/DOCKER_LOGIN_ACTION
+++ b/versions/actions/DOCKER_LOGIN_ACTION
@@ -1 +1 @@
-3.1.0
+3.3.0
diff --git a/versions/actions/DOCKER_SETUP_BUILDX_ACTION b/versions/actions/DOCKER_SETUP_BUILDX_ACTION
index 15a2799817..1545d96657 100644
--- a/versions/actions/DOCKER_SETUP_BUILDX_ACTION
+++ b/versions/actions/DOCKER_SETUP_BUILDX_ACTION
@@ -1 +1 @@
-3.3.0
+3.5.0
diff --git a/versions/actions/DOCKER_SETUP_QEMU_ACTION b/versions/actions/DOCKER_SETUP_QEMU_ACTION
index 4a36342fca..944880fa15 100644
--- a/versions/actions/DOCKER_SETUP_QEMU_ACTION
+++ b/versions/actions/DOCKER_SETUP_QEMU_ACTION
@@ -1 +1 @@
-3.0.0
+3.2.0
diff --git a/versions/actions/GITHUB_CODEQL_ACTION_ANALYZE b/versions/actions/GITHUB_CODEQL_ACTION_ANALYZE
index 94dc0ec910..cf8690732f 100644
--- a/versions/actions/GITHUB_CODEQL_ACTION_ANALYZE
+++ b/versions/actions/GITHUB_CODEQL_ACTION_ANALYZE
@@ -1 +1 @@
-2.17.2
+2.18.0
diff --git a/versions/actions/GITHUB_CODEQL_ACTION_AUTOBUILD b/versions/actions/GITHUB_CODEQL_ACTION_AUTOBUILD
index 94dc0ec910..cf8690732f 100644
--- a/versions/actions/GITHUB_CODEQL_ACTION_AUTOBUILD
+++ b/versions/actions/GITHUB_CODEQL_ACTION_AUTOBUILD
@@ -1 +1 @@
-2.17.2
+2.18.0
diff --git a/versions/actions/GITHUB_CODEQL_ACTION_INIT b/versions/actions/GITHUB_CODEQL_ACTION_INIT
index 94dc0ec910..cf8690732f 100644
--- a/versions/actions/GITHUB_CODEQL_ACTION_INIT
+++ b/versions/actions/GITHUB_CODEQL_ACTION_INIT
@@ -1 +1 @@
-2.17.2
+2.18.0
diff --git a/versions/actions/GITHUB_CODEQL_ACTION_UPLOAD_SARIF b/versions/actions/GITHUB_CODEQL_ACTION_UPLOAD_SARIF
index 94dc0ec910..cf8690732f 100644
--- a/versions/actions/GITHUB_CODEQL_ACTION_UPLOAD_SARIF
+++ b/versions/actions/GITHUB_CODEQL_ACTION_UPLOAD_SARIF
@@ -1 +1 @@
-2.17.2
+2.18.0
diff --git a/versions/actions/GITHUB_ISSUE_METRICS b/versions/actions/GITHUB_ISSUE_METRICS
index 18091983f5..19811903a7 100644
--- a/versions/actions/GITHUB_ISSUE_METRICS
+++ b/versions/actions/GITHUB_ISSUE_METRICS
@@ -1 +1 @@
-3.4.0
+3.8.0
diff --git a/versions/actions/REVIEWDOG_ACTION_HADOLINT b/versions/actions/REVIEWDOG_ACTION_HADOLINT
index f86fb9cbcf..50aceaa7b7 100644
--- a/versions/actions/REVIEWDOG_ACTION_HADOLINT
+++ b/versions/actions/REVIEWDOG_ACTION_HADOLINT
@@ -1 +1 @@
-1.41.1
+1.45.0
diff --git a/versions/actions/REVIEWDOG_ACTION_LANGUAGETOOL b/versions/actions/REVIEWDOG_ACTION_LANGUAGETOOL
index 850e742404..815d5ca06d 100644
--- a/versions/actions/REVIEWDOG_ACTION_LANGUAGETOOL
+++ b/versions/actions/REVIEWDOG_ACTION_LANGUAGETOOL
@@ -1 +1 @@
-1.14.0
+1.19.0
diff --git a/versions/actions/SOFTPROPS_ACTION_GH_RELEASE b/versions/actions/SOFTPROPS_ACTION_GH_RELEASE
index 3eefcb9dd5..815e68dd20 100644
--- a/versions/actions/SOFTPROPS_ACTION_GH_RELEASE
+++ b/versions/actions/SOFTPROPS_ACTION_GH_RELEASE
@@ -1 +1 @@
-1.0.0
+2.0.8