From 547bfd428b870c4d3efbdf6b9c23c27e56862327 Mon Sep 17 00:00:00 2001 From: kpango Date: Tue, 23 Jul 2024 11:05:17 +0900 Subject: [PATCH] refactor index manager service add index service API to expose index informations Signed-off-by: kpango --- .cspell.json | 74 + .deepsource.toml | 27 +- .gitfiles | 28 +- .github/ISSUE_TEMPLATE/bug_report.md | 6 +- .../ISSUE_TEMPLATE/security_issue_report.md | 6 +- .github/PULL_REQUEST_TEMPLATE.md | 6 +- .github/actions/docker-build/action.yaml | 6 +- .../e2e-deploy-vald-helm-operator/action.yaml | 8 +- .github/workflows/format.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/reviewdog.yml | 17 +- Makefile | 105 +- Makefile.d/build.mk | 31 +- Makefile.d/dependencies.mk | 9 +- Makefile.d/docker.mk | 5 + Makefile.d/e2e.mk | 41 + Makefile.d/functions.mk | 21 +- Makefile.d/k3d.mk | 2 +- Makefile.d/k8s.mk | 181 +- Makefile.d/proto.mk | 1 + Makefile.d/tools.mk | 63 +- apis/docs/v1/docs.md | 107 +- apis/grpc/v1/agent/core/agent.go | 2 - apis/grpc/v1/agent/core/agent.pb.go | 79 +- apis/grpc/v1/agent/core/agent_vtproto.pb.go | 114 +- apis/grpc/v1/agent/sidecar/sidecar.pb.go | 4 +- apis/grpc/v1/discoverer/discoverer.pb.go | 4 +- .../v1/discoverer/discoverer_vtproto.pb.go | 42 +- .../grpc/v1/filter/egress/egress_filter.pb.go | 4 +- .../filter/egress/egress_filter_vtproto.pb.go | 28 +- .../v1/filter/ingress/ingress_filter.pb.go | 4 +- .../ingress/ingress_filter_vtproto.pb.go | 28 +- .../grpc/v1/manager/index/index_manager.pb.go | 103 - apis/grpc/v1/mirror/mirror.pb.go | 4 +- apis/grpc/v1/mirror/mirror_vtproto.pb.go | 14 +- apis/grpc/v1/payload/payload.pb.go | 767 ++++--- apis/grpc/v1/payload/payload.pb.json.go | 18 +- apis/grpc/v1/payload/payload_vtproto.pb.go | 491 ++++- .../v1/rpc/errdetails/error_details.pb.go | 35 +- .../rpc/errdetails/error_details.pb.json.go | 7 +- .../errdetails/error_details_vtproto.pb.go | 3 +- apis/grpc/v1/vald/filter.pb.go | 4 +- apis/grpc/v1/vald/filter_vtproto.pb.go | 136 +- apis/grpc/v1/vald/flush.pb.go | 4 +- apis/grpc/v1/vald/flush_vtproto.pb.go | 14 +- apis/grpc/v1/vald/index.pb.go | 108 + .../index_vtproto.pb.go} | 68 +- apis/grpc/v1/vald/insert.pb.go | 4 +- apis/grpc/v1/vald/insert_vtproto.pb.go | 34 +- apis/grpc/v1/vald/object.pb.go | 55 +- apis/grpc/v1/vald/object_vtproto.pb.go | 88 +- apis/grpc/v1/vald/remove.pb.go | 4 +- apis/grpc/v1/vald/remove_vtproto.pb.go | 48 +- apis/grpc/v1/vald/search.pb.go | 4 +- apis/grpc/v1/vald/search_vtproto.pb.go | 136 +- apis/grpc/v1/vald/update.pb.go | 4 +- apis/grpc/v1/vald/update_vtproto.pb.go | 34 +- apis/grpc/v1/vald/upsert.pb.go | 4 +- apis/grpc/v1/vald/upsert_vtproto.pb.go | 34 +- apis/grpc/v1/vald/vald.go | 78 +- apis/proto/v1/agent/core/agent.proto | 14 +- apis/proto/v1/payload/payload.proto | 11 +- .../index_manager.proto => vald/index.proto} | 12 +- apis/proto/v1/vald/object.proto | 5 + apis/swagger/v1/agent/core/agent.swagger.json | 110 +- .../index.swagger.json} | 46 +- apis/swagger/v1/vald/object.swagger.json | 44 + apis/swagger/v1/vald/remove.swagger.json | 30 +- assets/test/templates/option/function.tmpl | 2 +- .../templates/operator.yaml | 2 - charts/vald/README.md | 22 + .../templates/gateway/filter/configmap.yaml | 22 +- charts/vald/templates/gateway/ing.yaml | 96 +- charts/vald/values.go | 4 +- charts/vald/values.schema.json | 92 + cmd/agent/core/faiss/main.go | 4 +- cmd/agent/core/ngt/main.go | 4 +- cmd/agent/sidecar/main.go | 4 +- cmd/discoverer/k8s/main.go | 4 +- cmd/gateway/filter/main.go | 4 +- cmd/gateway/lb/main.go | 4 +- cmd/gateway/mirror/main.go | 4 +- cmd/index/job/correction/main.go | 4 +- cmd/index/job/creation/main.go | 4 +- cmd/index/job/readreplica/rotate/main.go | 4 +- cmd/index/job/save/main.go | 4 +- cmd/index/operator/main.go | 4 +- cmd/manager/index/main.go | 4 +- cmd/tools/benchmark/job/main.go | 4 +- cmd/tools/benchmark/operator/main.go | 4 +- cmd/tools/cli/benchmark/core/main.go | 13 +- cmd/tools/cli/loadtest/main.go | 4 +- dockers/agent/core/agent/Dockerfile | 105 +- dockers/agent/core/faiss/Dockerfile | 126 +- dockers/agent/core/ngt/Dockerfile | 107 +- dockers/agent/sidecar/Dockerfile | 99 +- dockers/ci/base/Dockerfile | 125 +- dockers/dev/Dockerfile | 106 +- dockers/discoverer/k8s/Dockerfile | 98 +- dockers/gateway/filter/Dockerfile | 97 +- dockers/gateway/lb/Dockerfile | 97 +- dockers/gateway/mirror/Dockerfile | 98 +- dockers/index/job/correction/Dockerfile | 97 +- dockers/index/job/creation/Dockerfile | 97 +- .../index/job/readreplica/rotate/Dockerfile | 97 +- dockers/index/job/save/Dockerfile | 97 +- dockers/index/operator/Dockerfile | 98 +- dockers/manager/index/Dockerfile | 97 +- dockers/operator/helm/Dockerfile | 145 +- .../job/readreplica/rotate/Dockerfile | 110 + dockers/tools/benchmark/job/Dockerfile | 132 +- dockers/tools/benchmark/operator/Dockerfile | 99 +- dockers/tools/cli/loadtest/Dockerfile | 143 +- docs/api/build_proto.md | 4 +- docs/api/filter-gateway.md | 2 +- docs/api/remove.md | 8 +- docs/contributing/coding-style.md | 24 +- docs/contributing/development.md | 2 +- docs/contributing/unit-test-guideline.md | 12 +- docs/overview/architecture.md | 2 +- docs/overview/data-flow.md | 2 +- docs/tutorial/vald-multicluster-on-k8s.md | 2 +- docs/user-guides/configuration.md | 4 +- docs/user-guides/deployment.md | 2 +- .../observability-configuration.md | 10 +- docs/user-guides/upgrade-cluster.md | 4 +- example/client/agent/main.go | 38 +- example/client/go.mod | 34 +- example/client/go.mod.default | 2 +- example/client/go.sum | 32 +- example/client/main.go | 22 +- example/client/mirror/main.go | 24 +- go.mod | 330 +-- go.sum | 617 +++--- hack/benchmark/assets/x1b/loader.go | 8 +- .../benchmark/assets/x1b/loader_bench_test.go | 4 +- hack/benchmark/assets/x1b/loader_test.go | 18 +- .../core/benchmark/strategy/bulk_insert.go | 4 +- .../benchmark/strategy/bulk_insert_commit.go | 4 +- .../core/benchmark/strategy/get_vector.go | 4 +- .../core/benchmark/strategy/insert.go | 4 +- .../core/benchmark/strategy/insert_commit.go | 4 +- .../core/benchmark/strategy/remove.go | 4 +- .../core/benchmark/strategy/search.go | 4 +- .../core/benchmark/strategy/strategy.go | 16 +- .../benchmark/strategy/strategy_option.go | 4 +- .../strategy/strategy_option_test.go | 4 +- .../core/benchmark/strategy/strategy_test.go | 24 +- .../benchmark/core/benchmark/strategy/util.go | 8 +- hack/benchmark/core/ngt/ngt_bench_test.go | 4 +- .../internal/core/algorithm/algorithm.go | 4 +- .../internal/core/algorithm/ngt/ngt.go | 4 +- .../internal/core/algorithm/ngt/ngt_test.go | 6 +- .../db/nosql/cassandra/cassandra_test.go | 6 +- hack/benchmark/internal/operation/util.go | 2 +- .../benchmark/internal/operation/util_test.go | 2 +- .../singleflight/singleflight_bench_test.go | 2 +- hack/docker/gen/main.go | 746 +++++++ hack/git/hooks/pre-commit | 24 +- hack/go.mod.default | 21 +- hack/gorules/rules.go | 4 +- hack/license/gen/main.go | 4 + internal/backoff/backoff.go | 8 +- internal/backoff/backoff_test.go | 30 +- internal/cache/gache/gache.go | 4 +- internal/cache/gache/gache_test.go | 18 +- internal/circuitbreaker/breaker.go | 4 +- internal/circuitbreaker/breaker_test.go | 8 +- internal/circuitbreaker/manager.go | 6 +- internal/circuitbreaker/manager_test.go | 8 +- .../client/v1/client/agent/core/client.go | 110 +- .../v1/client/agent/core/client_test.go | 4 +- internal/client/v1/client/client.go | 2 +- .../client/v1/client/discoverer/discover.go | 16 +- .../client/v1/client/filter/egress/client.go | 32 +- .../client/v1/client/filter/ingress/client.go | 34 +- internal/client/v1/client/mirror/mirror.go | 6 +- internal/client/v1/client/mirror/option.go | 4 +- internal/client/v1/client/vald/vald.go | 402 +++- internal/compress/gob/gob.go | 4 +- internal/compress/gob/gob_mock.go | 8 +- internal/compress/gob_test.go | 16 +- internal/compress/lz4_option.go | 4 +- internal/compress/zstd_option.go | 4 +- internal/config/config.go | 4 +- internal/config/config_test.go | 34 +- internal/config/meta.go | 4 +- internal/conv/conv_bench_test.go | 4 +- internal/core/algorithm/faiss/option.go | 4 + internal/core/algorithm/ngt/ngt.go | 10 +- internal/db/kvs/pogreb/pogreb.go | 1 - internal/db/kvs/redis/hook.go | 4 +- internal/db/kvs/redis/list.go | 2 +- internal/db/kvs/redis/set.go | 4 +- internal/db/nosql/cassandra/observer.go | 4 +- internal/db/rdb/mysql/dbr/dbr.go | 8 +- internal/db/rdb/mysql/dbr/dbr_mock.go | 28 +- internal/db/rdb/mysql/dbr/delete.go | 4 +- internal/db/rdb/mysql/dbr/insert.go | 4 +- internal/db/rdb/mysql/dbr/select.go | 12 +- internal/db/rdb/mysql/dbr/tx.go | 8 +- internal/db/rdb/mysql/mysql_test.go | 346 ++-- .../db/storage/blob/cloudstorage/option.go | 4 +- .../storage/blob/cloudstorage/option_test.go | 4 +- .../blob/cloudstorage/urlopener/option.go | 4 +- internal/db/storage/blob/s3/reader/io/io.go | 4 +- internal/db/storage/blob/s3/reader/reader.go | 10 +- .../db/storage/blob/s3/reader/reader_mock.go | 8 +- internal/db/storage/blob/s3/sdk/s3/s3.go | 4 +- .../db/storage/blob/s3/writer/writer_mock.go | 8 +- internal/encoding/json/json.go | 10 +- internal/encoding/json/json_test.go | 8 +- internal/errors/agent_test.go | 4 +- internal/errors/benchmark.go | 2 +- internal/errors/errors.go | 8 +- internal/errors/errors_benchmark_test.go | 4 +- internal/errors/errors_test.go | 36 +- internal/errors/file_test.go | 4 +- internal/errors/filter_test.go | 4 +- internal/errors/grpc.go | 2 +- internal/errors/info_test.go | 4 +- internal/errors/option.go | 4 +- internal/errors/option_test.go | 4 +- internal/errors/runtime.go | 2 +- internal/errors/runtime_test.go | 2 +- internal/errors/unit_test.go | 4 +- internal/errors/vald_test.go | 4 +- internal/file/file.go | 18 +- internal/info/info.go | 54 +- internal/info/info_bench_test.go | 4 +- internal/info/info_test.go | 1833 ----------------- internal/info/option_test.go | 5 + internal/io/copy.go | 6 +- internal/io/copy_test.go | 2 +- internal/io/io.go | 2 +- internal/k8s/client/client.go | 22 +- internal/k8s/client/option.go | 4 +- internal/k8s/job/job.go | 6 +- internal/k8s/metrics/node/node.go | 4 +- internal/k8s/metrics/pod/pod.go | 4 +- internal/k8s/node/node.go | 13 +- internal/k8s/node/node_test.go | 4 +- internal/k8s/pod/pod.go | 4 +- internal/k8s/service/service.go | 4 +- internal/k8s/v2/pod/option.go | 4 +- internal/k8s/v2/pod/pod.go | 4 +- internal/k8s/vald/benchmark/job/job.go | 4 +- internal/k8s/vald/benchmark/job/option.go | 4 +- .../k8s/vald/benchmark/scenario/option.go | 4 +- .../k8s/vald/benchmark/scenario/scenario.go | 4 +- internal/k8s/vald/mirror/target/target.go | 4 +- internal/log/glg/glg.go | 30 +- internal/log/glg/glg_test.go | 66 +- internal/log/log.go | 30 +- internal/log/log_test.go | 110 +- internal/log/logger/iface.go | 30 +- internal/log/mock/logger.go | 50 +- internal/log/mock/logger_test.go | 210 +- internal/log/mock/retry.go | 18 +- internal/log/mock/retry_test.go | 24 +- internal/log/nop/nop.go | 34 +- internal/log/nop/nop_test.go | 30 +- internal/log/retry/option.go | 6 +- internal/log/retry/option_test.go | 8 +- internal/log/retry/retry.go | 22 +- internal/log/retry/retry_test.go | 38 +- internal/log/zap/zap.go | 30 +- internal/log/zap/zap_test.go | 70 +- internal/net/control/control_unix.go | 4 +- internal/net/control/control_windows.go | 4 +- internal/net/dialer.go | 4 +- internal/net/grpc/admin/admin.go | 4 +- internal/net/grpc/client.go | 78 +- internal/net/grpc/client_test.go | 24 +- internal/net/grpc/codec.go | 4 +- internal/net/grpc/codec_test.go | 4 +- internal/net/grpc/errdetails/errdetails.go | 44 +- .../net/grpc/errdetails/errdetails_test.go | 4 +- internal/net/grpc/handler.go | 4 +- internal/net/grpc/interceptor.go | 4 +- .../grpc/interceptor/client/trace/trace.go | 4 +- .../interceptor/server/logging/accesslog.go | 6 +- .../grpc/interceptor/server/metric/metric.go | 4 +- .../interceptor/server/recover/recover.go | 6 +- internal/net/grpc/logger/logger.go | 24 +- internal/net/grpc/logger/logger_test.go | 48 +- internal/net/grpc/pool/pool.go | 6 +- internal/net/grpc/status/status.go | 44 +- internal/net/grpc/status/status_test.go | 42 +- internal/net/grpc/stream.go | 9 +- internal/net/grpc/stream_test.go | 10 +- internal/net/grpc/types/types.go | 4 +- internal/net/http/dump/dump.go | 24 +- internal/net/http/dump/dump_test.go | 14 +- internal/net/http/json/json.go | 36 +- internal/net/http/json/json_test.go | 30 +- internal/net/http/metrics/pprof.go | 25 + internal/net/http/rest/rest.go | 4 +- internal/net/http/routing/router.go | 4 +- internal/net/http/transport/roundtrip.go | 2 +- internal/net/http/transport/roundtrip_mock.go | 6 +- internal/net/http/transport/roundtrip_test.go | 12 +- .../metrics/agent/sidecar/sidecar.go | 4 +- internal/observability/metrics/info/info.go | 4 +- .../observability/metrics/info/info_test.go | 4 +- .../metrics/tools/benchmark/benchmark.go | 10 +- internal/observability/trace/status.go | 2 +- internal/observability/trace/trace.go | 4 +- internal/rand/rand.go | 2 +- internal/rand/rand_test.go | 2 +- internal/runner/option.go | 4 +- internal/runner/option_test.go | 8 +- internal/runner/runner.go | 4 +- internal/runner/runner_race_test.go | 12 +- internal/servers/servers_mock.go | 4 +- internal/strings/strings.go | 2 +- internal/sync/singleflight/singleflight.go | 12 +- .../sync/singleflight/singleflight_test.go | 8 +- internal/test/data/hdf5/option.go | 4 +- internal/test/data/hdf5/option_test.go | 4 +- internal/test/data/request/insert.go | 8 +- .../test/mock/client/mirror_client_mock.go | 20 +- internal/test/mock/controller_runtime.go | 8 +- internal/test/mock/grpc/grpc_client_mock.go | 7 +- internal/test/mock/grpc_testify_mock.go | 40 +- internal/test/mock/k8s/client.go | 36 +- internal/test/mock/k8s/controller_runtime.go | 20 +- internal/test/mock/server_stream.go | 8 +- internal/test/testify/testify.go | 4 +- internal/timeutil/location/loc.go | 4 +- internal/timeutil/location/loc_bench_test.go | 4 +- internal/tls/tls.go | 16 +- internal/worker/worker_option.go | 4 +- k8s/operator/helm/operator.yaml | 2 - pkg/agent/core/faiss/handler/grpc/flush.go | 6 +- pkg/agent/core/faiss/handler/grpc/index.go | 12 +- pkg/agent/core/faiss/handler/grpc/insert.go | 10 +- .../core/faiss/handler/grpc/linear_search.go | 20 +- pkg/agent/core/faiss/handler/grpc/object.go | 8 +- pkg/agent/core/faiss/handler/grpc/remove.go | 10 +- pkg/agent/core/faiss/handler/grpc/search.go | 18 +- pkg/agent/core/faiss/handler/grpc/update.go | 10 +- pkg/agent/core/faiss/handler/grpc/upsert.go | 8 +- pkg/agent/core/faiss/handler/rest/handler.go | 34 +- pkg/agent/core/faiss/service/faiss.go | 4 +- pkg/agent/core/ngt/handler/grpc/flush.go | 18 +- .../core/ngt/handler/grpc/handler_test.go | 13 +- pkg/agent/core/ngt/handler/grpc/index.go | 39 +- pkg/agent/core/ngt/handler/grpc/insert.go | 10 +- .../core/ngt/handler/grpc/insert_test.go | 4 +- .../core/ngt/handler/grpc/linear_search.go | 22 +- pkg/agent/core/ngt/handler/grpc/object.go | 16 +- .../core/ngt/handler/grpc/object_test.go | 6 +- pkg/agent/core/ngt/handler/grpc/remove.go | 14 +- pkg/agent/core/ngt/handler/grpc/search.go | 18 +- pkg/agent/core/ngt/handler/grpc/update.go | 10 +- pkg/agent/core/ngt/handler/grpc/upsert.go | 8 +- pkg/agent/core/ngt/handler/rest/handler.go | 34 +- pkg/agent/core/ngt/service/ngt.go | 62 +- .../core/ngt/service/ngt_stateful_test.go | 2 +- pkg/agent/core/ngt/service/ngt_test.go | 40 +- pkg/agent/internal/kvs/option.go | 4 +- pkg/agent/internal/vqueue/queue.go | 4 +- pkg/agent/sidecar/handler/rest/handler.go | 4 +- pkg/agent/sidecar/handler/rest/option.go | 4 +- pkg/agent/sidecar/router/option.go | 4 +- .../sidecar/service/restorer/restorer.go | 2 +- pkg/discoverer/k8s/config/config.go | 4 +- pkg/discoverer/k8s/handler/grpc/handler.go | 12 +- pkg/discoverer/k8s/handler/rest/handler.go | 8 +- pkg/discoverer/k8s/service/discover.go | 16 +- pkg/gateway/filter/handler/grpc/handler.go | 120 +- pkg/gateway/filter/handler/rest/handler.go | 62 +- pkg/gateway/filter/router/option.go | 4 +- pkg/gateway/lb/handler/grpc/aggregation.go | 11 +- pkg/gateway/lb/handler/grpc/handler.go | 536 ++++- .../lb/handler/grpc/search_benchmark_test.go | 9 +- pkg/gateway/lb/handler/rest/handler.go | 46 +- pkg/gateway/lb/router/option.go | 4 +- pkg/gateway/lb/service/gateway.go | 8 +- pkg/gateway/lb/usecase/vald.go | 4 +- pkg/gateway/mirror/handler/grpc/handler.go | 186 +- pkg/gateway/mirror/handler/grpc/mock_test.go | 7 +- pkg/gateway/mirror/handler/rest/handler.go | 48 +- pkg/gateway/mirror/router/option.go | 4 +- pkg/gateway/mirror/service/discovery.go | 20 +- pkg/gateway/mirror/service/gateway.go | 19 +- .../mirror/service/gateway_mock_test.go | 17 +- pkg/gateway/mirror/service/mirror.go | 4 +- pkg/index/job/correction/service/corrector.go | 33 +- pkg/index/job/correction/service/options.go | 6 +- pkg/index/job/creation/service/indexer.go | 5 +- .../job/readreplica/rotate/service/rotator.go | 12 +- pkg/index/job/save/service/indexer.go | 5 +- pkg/index/operator/service/operator.go | 18 +- pkg/index/operator/usecase/operator.go | 2 +- pkg/manager/index/handler/grpc/handler.go | 18 +- .../index/handler/grpc/handler_test.go | 110 + pkg/manager/index/handler/grpc/option.go | 4 +- pkg/manager/index/handler/rest/handler.go | 8 +- pkg/manager/index/handler/rest/option.go | 2 +- pkg/manager/index/router/option.go | 4 +- pkg/manager/index/service/indexer.go | 254 ++- pkg/manager/index/service/indexer_test.go | 145 ++ pkg/manager/index/service/option.go | 26 +- pkg/manager/index/usecase/indexer.go | 3 +- .../benchmark/job/handler/rest/handler.go | 2 +- pkg/tools/benchmark/job/service/option.go | 3 +- pkg/tools/benchmark/operator/config/config.go | 4 +- .../operator/handler/rest/handler.go | 2 +- .../benchmark/operator/service/operator.go | 20 +- pkg/tools/cli/loadtest/assets/dataset.go | 4 +- pkg/tools/cli/loadtest/assets/hdf5_loader.go | 8 +- .../cli/loadtest/assets/large_dataset.go | 8 +- .../cli/loadtest/assets/large_dataset_test.go | 12 +- .../cli/loadtest/assets/small_dataset.go | 4 +- .../cli/loadtest/assets/small_dataset_test.go | 12 +- pkg/tools/cli/loadtest/service/insert.go | 18 +- pkg/tools/cli/loadtest/service/loader.go | 20 +- pkg/tools/cli/loadtest/service/loader_test.go | 4 +- pkg/tools/cli/loadtest/service/search.go | 8 +- rust/Cargo.lock | 202 +- rust/bin/agent/src/handler/index.rs | 12 +- rust/libs/proto/src/core.v1.tonic.rs | 175 +- rust/libs/proto/src/manager.index.v1.rs | 0 rust/libs/proto/src/manager.index.v1.tonic.rs | 312 --- rust/libs/proto/src/payload.v1.rs | 16 +- rust/libs/proto/src/vald.v1.tonic.rs | 478 ++++- tests/e2e/hdf5/hdf5.go | 4 +- tests/e2e/kubernetes/client/client.go | 28 +- tests/e2e/kubernetes/kubectl/kubectl.go | 4 +- tests/e2e/operation/job.go | 16 + tests/e2e/operation/operation.go | 18 +- tests/e2e/operation/stream.go | 12 +- versions/GOLANGCILINT_VERSION | 2 +- versions/GO_VERSION | 2 +- versions/HDF5_VERSION | 2 +- versions/HELM_DOCS_VERSION | 2 +- versions/HELM_VERSION | 2 +- versions/JAEGER_OPERATOR_VERSION | 2 +- versions/K3S_VERSION | 2 +- versions/KIND_VERSION | 2 +- versions/KUBECTL_VERSION | 2 +- versions/NGT_VERSION | 2 +- versions/OPERATOR_SDK_VERSION | 2 +- versions/PROMETHEUS_STACK_VERSION | 2 +- versions/PROTOBUF_VERSION | 2 +- versions/REVIEWDOG_VERSION | 2 +- versions/TELEPRESENCE_VERSION | 2 +- versions/YQ_VERSION | 2 +- versions/actions/ACTIONS_CHECKOUT | 2 +- versions/actions/ACTIONS_DOWNLOAD_ARTIFACT | 2 +- versions/actions/ACTIONS_SETUP_GO | 2 +- versions/actions/ACTIONS_SETUP_NODE | 2 +- versions/actions/ACTIONS_UPLOAD_ARTIFACT | 2 +- versions/actions/CODECOV_CODECOV_ACTION | 2 +- versions/actions/DOCKER_LOGIN_ACTION | 2 +- versions/actions/DOCKER_SETUP_BUILDX_ACTION | 2 +- versions/actions/DOCKER_SETUP_QEMU_ACTION | 2 +- versions/actions/GITHUB_CODEQL_ACTION_ANALYZE | 2 +- .../actions/GITHUB_CODEQL_ACTION_AUTOBUILD | 2 +- versions/actions/GITHUB_CODEQL_ACTION_INIT | 2 +- .../actions/GITHUB_CODEQL_ACTION_UPLOAD_SARIF | 2 +- versions/actions/GITHUB_ISSUE_METRICS | 2 +- versions/actions/REVIEWDOG_ACTION_HADOLINT | 2 +- .../actions/REVIEWDOG_ACTION_LANGUAGETOOL | 2 +- versions/actions/SOFTPROPS_ACTION_GH_RELEASE | 2 +- 467 files changed, 9429 insertions(+), 7677 deletions(-) delete mode 100644 apis/grpc/v1/manager/index/index_manager.pb.go create mode 100644 apis/grpc/v1/vald/index.pb.go rename apis/grpc/v1/{manager/index/index_manager_vtproto.pb.go => vald/index_vtproto.pb.go} (63%) rename apis/proto/v1/{manager/index/index_manager.proto => vald/index.proto} (72%) rename apis/swagger/v1/{manager/index/index_manager.swagger.json => vald/index.swagger.json} (84%) create mode 100644 dockers/readreplica/job/readreplica/rotate/Dockerfile create mode 100644 hack/docker/gen/main.go delete mode 100644 internal/info/info_test.go delete mode 100644 rust/libs/proto/src/manager.index.v1.rs delete mode 100644 rust/libs/proto/src/manager.index.v1.tonic.rs diff --git a/.cspell.json b/.cspell.json index 8038e73fbb2..71ced17ccf0 100644 --- a/.cspell.json +++ b/.cspell.json @@ -2,28 +2,47 @@ "version": "0.2", "language": "en", "words": [ + "ACCESSS", "AQUASECURITY", "AUTOBUILD", "BUILDX", + "Burstable", "Capi", + "Errorf", "FAISS", "GHACTION", "GOLANGCILINT", + "GOMAXPROCS", + "Godoc", + "Infof", "KUBELINTER", "LANGUAGETOOL", + "Milli", + "ONNX", "OTEL", "PROTOBUF", "REVIEWDOG", + "Roundtripper", "SARIF", "SOFTPROPS", + "Structs", "TELEPRESENCE", "VALD", "VALDCLI", + "VHOR", "Vald", + "Vectorizer", "accesslog", + "achive", + "addrs", + "apiserver", + "attirbute", "bbolt", + "boudary", "brandguidelines", + "buildbase", "chatops", + "chrono", "circuitbreaker", "cloudstorage", "clusterrole", @@ -32,38 +51,67 @@ "contributorsrc", "conv", "crds", + "crlfmt", + "ctxio", "daemonset", "deepsource", "devcontainer", + "devel", + "envoyproxy", "errdetails", "errgroup", + "facebookresearch", "faiss", + "fastime", + "fuid", "gache", + "getobject", "getstarted", "gitfiles", + "gofumpt", + "goimports", "golangci", "goleak", + "golines", "gongt", + "gonum", "gorules", + "gotest", + "gotests", "gotmpl", "hadolint", "helmignore", + "httputil", + "icfg", "initcontainer", + "innerproduct", + "ioutil", "jaccard", "japansearch", "kosarak", + "kpango", "kubelinter", "kustomization", "kvsdb", + "libhdf", + "loadbalancer", "loadtest", "lycorp", + "maxprocs", "minio", "mnist", "multiapis", "multicluster", + "nanos", + "nbits", "networkpolicy", + "nlist", + "normalizedangle", + "normalizedcosine", "nosql", "nytimes", + "oneof", + "onnx", "otel", "otlp", "pogreb", @@ -72,17 +120,33 @@ "priorityclass", "profefe", "promtail", + "prost", "protobuf", + "protoc", + "protos", "pyroscope", "readreplica", + "rebalance", + "rebalancing", + "replicasets", + "rerank", + "retrive", "reviewdog", + "rustc", + "rustup", "serviceaccount", "singleflight", "statefulset", + "steamsearch", + "streaminsert", + "structs", + "subtests", "testdata", "textlintrc", "timeutil", + "traefik", "upsert", + "upserted", "urlopener", "usecase", "vald", @@ -90,12 +154,22 @@ "valdbenchmarkoperatorrelease", "valdbenchmarkscenario", "valdhelmoperatorrelease", + "valdhelmopratorreleases", "valdmirrortarget", + "valdmirrortargets", "valdrelease", + "vbor", + "vdaas", "vdctl", + "vectorizer", + "vectorizing", + "vhor", "vqueue", "vtproto", + "werr", "whitesource", + "yahoojapan", + "yamlfmt", "zstd" ], "ignoreWords": [ diff --git a/.deepsource.toml b/.deepsource.toml index e8f0da1fa1f..0eb01057c99 100644 --- a/.deepsource.toml +++ b/.deepsource.toml @@ -47,22 +47,35 @@ enabled = true [analyzers.meta] dockerfile_paths = [ - "dockers/agent/ngt/Dockerfile", - "dockers/discoverer/k8s/Dockerfile", + "dockers/agent/core/agent/Dockerfile", + "dockers/agent/core/faiss/Dockerfile", + "dockers/agent/core/ngt/Dockerfile", "dockers/agent/sidecar/Dockerfile", - "dockers/gateway/lb/Dockerfile", + "dockers/buildbase/Dockerfile", + "dockers/ci/base/Dockerfile", + "dockers/dev/Dockerfile", + "dockers/discoverer/k8s/Dockerfile", "dockers/gateway/filter/Dockerfile", + "dockers/gateway/lb/Dockerfile", + "dockers/gateway/mirror/Dockerfile", + "dockers/index/job/correction/Dockerfile", + "dockers/index/job/creation/Dockerfile", + "dockers/index/job/readreplica/rotate/Dockerfile", + "dockers/index/job/save/Dockerfile", + "dockers/index/operator/Dockerfile", "dockers/manager/index/Dockerfile", "dockers/operator/helm/Dockerfile", - "dockers/ci/base/Dockerfile", - "dockers/dev/Dockerfile", + "dockers/readreplica/job/readreplica/rotate/Dockerfile", + "dockers/tools/benchmark/job/Dockerfile", + "dockers/tools/benchmark/operator/Dockerfile", "dockers/tools/cli/loadtest/Dockerfile" ] trusted_registries = [ "docker.io", - "hub.docker.com", - "ghcr.io/vdaas/vald" + "gcr.io/distroless", + "ghcr.io/vdaas/vald", + "hub.docker.com" ] [[analyzers]] diff --git a/.gitfiles b/.gitfiles index 6389d905f6e..cb4b43dac70 100644 --- a/.gitfiles +++ b/.gitfiles @@ -80,6 +80,7 @@ .github/workflows/dockers-agent-sidecar-image.yml .github/workflows/dockers-benchmark-job-image.yml .github/workflows/dockers-benchmark-operator-image.yaml +.github/workflows/dockers-buildbase-image.yml .github/workflows/dockers-ci-container-image.yml .github/workflows/dockers-dev-container-image.yml .github/workflows/dockers-discoverer-k8s-image.yml @@ -161,8 +162,6 @@ apis/grpc/v1/filter/egress/egress_filter.pb.go apis/grpc/v1/filter/egress/egress_filter_vtproto.pb.go apis/grpc/v1/filter/ingress/ingress_filter.pb.go apis/grpc/v1/filter/ingress/ingress_filter_vtproto.pb.go -apis/grpc/v1/manager/index/index_manager.pb.go -apis/grpc/v1/manager/index/index_manager_vtproto.pb.go apis/grpc/v1/mirror/mirror.go apis/grpc/v1/mirror/mirror.pb.go apis/grpc/v1/mirror/mirror_vtproto.pb.go @@ -177,6 +176,8 @@ apis/grpc/v1/vald/filter.pb.go apis/grpc/v1/vald/filter_vtproto.pb.go apis/grpc/v1/vald/flush.pb.go apis/grpc/v1/vald/flush_vtproto.pb.go +apis/grpc/v1/vald/index.pb.go +apis/grpc/v1/vald/index_vtproto.pb.go apis/grpc/v1/vald/insert.pb.go apis/grpc/v1/vald/insert_vtproto.pb.go apis/grpc/v1/vald/object.pb.go @@ -197,12 +198,12 @@ apis/proto/v1/agent/sidecar/sidecar.proto apis/proto/v1/discoverer/discoverer.proto apis/proto/v1/filter/egress/egress_filter.proto apis/proto/v1/filter/ingress/ingress_filter.proto -apis/proto/v1/manager/index/index_manager.proto apis/proto/v1/mirror/mirror.proto apis/proto/v1/payload/payload.proto apis/proto/v1/rpc/errdetails/error_details.proto apis/proto/v1/vald/filter.proto apis/proto/v1/vald/flush.proto +apis/proto/v1/vald/index.proto apis/proto/v1/vald/insert.proto apis/proto/v1/vald/object.proto apis/proto/v1/vald/remove.proto @@ -214,12 +215,12 @@ apis/swagger/v1/agent/sidecar/sidecar.swagger.json apis/swagger/v1/discoverer/discoverer.swagger.json apis/swagger/v1/filter/egress/egress_filter.swagger.json apis/swagger/v1/filter/ingress/ingress_filter.swagger.json -apis/swagger/v1/manager/index/index_manager.swagger.json apis/swagger/v1/mirror/mirror.swagger.json apis/swagger/v1/payload/payload.swagger.json apis/swagger/v1/rpc/errdetails/error_details.swagger.json apis/swagger/v1/vald/filter.swagger.json apis/swagger/v1/vald/flush.swagger.json +apis/swagger/v1/vald/index.swagger.json apis/swagger/v1/vald/insert.swagger.json apis/swagger/v1/vald/object.swagger.json apis/swagger/v1/vald/remove.swagger.json @@ -228,6 +229,7 @@ apis/swagger/v1/vald/update.swagger.json apis/swagger/v1/vald/upsert.swagger.json assets/docs/guides/observability-configuration/architecture.png assets/docs/guides/operations/grafana-example.png +assets/docs/guides/read-replica-and-rotator/architecture.png assets/docs/overview/component/agent/agent.drawio assets/docs/overview/component/agent/ngt.png assets/docs/overview/component/agent/sidecar_backup.png @@ -516,6 +518,7 @@ dockers/agent/core/ngt/Dockerfile dockers/agent/core/ngt/README.md dockers/agent/sidecar/Dockerfile dockers/agent/sidecar/README.md +dockers/buildbase/Dockerfile dockers/ci/base/Dockerfile dockers/ci/base/README.md dockers/dev/Dockerfile @@ -536,6 +539,7 @@ dockers/manager/index/Dockerfile dockers/manager/index/README.md dockers/operator/helm/Dockerfile dockers/operator/helm/README.md +dockers/readreplica/job/readreplica/rotate/Dockerfile dockers/template.md dockers/tools/benchmark/job/Dockerfile dockers/tools/benchmark/operator/Dockerfile @@ -556,6 +560,7 @@ docs/api/upsert.md docs/contributing/coding-style.md docs/contributing/contributing-guide.md docs/contributing/development.md +docs/contributing/reviewer-guideline.md docs/contributing/unit-test-guideline.md docs/overview/about-vald.md docs/overview/architecture.md @@ -571,8 +576,8 @@ docs/performance/benchmark.md docs/performance/continuous-benchmark.md docs/performance/loadtest.md docs/performance/tuning-search-performance.md +docs/support/FAQ.md docs/support/contacts.md -docs/support/faq.md docs/troubleshooting/README.md docs/troubleshooting/client-side.md docs/troubleshooting/mirror-gateway.md @@ -595,6 +600,7 @@ docs/user-guides/mirroring-configuration.md docs/user-guides/network-policy.md docs/user-guides/observability-configuration.md docs/user-guides/operations.md +docs/user-guides/read-replica-and-rotator.md docs/user-guides/sdks.md docs/user-guides/upgrade-cluster.md example/client/agent/main.go @@ -686,6 +692,7 @@ hack/benchmark/internal/starter/gateway/vald/vald_test.go hack/benchmark/internal/starter/starter.go hack/benchmark/metrics/metrics.go hack/benchmark/src/singleflight/singleflight_bench_test.go +hack/docker/gen/main.go hack/git/hooks/pre-commit hack/go.mod.default hack/gorules/rules.go @@ -1016,7 +1023,6 @@ internal/hash/hash.go internal/hash/hash_test.go internal/info/info.go internal/info/info_bench_test.go -internal/info/info_test.go internal/info/option.go internal/info/option_test.go internal/io/copy.go @@ -1820,6 +1826,14 @@ renovate.json rust/Cargo.lock rust/Cargo.toml rust/bin/agent/Cargo.toml +rust/bin/agent/src/handler.rs +rust/bin/agent/src/handler/common.rs +rust/bin/agent/src/handler/index.rs +rust/bin/agent/src/handler/insert.rs +rust/bin/agent/src/handler/remove.rs +rust/bin/agent/src/handler/search.rs +rust/bin/agent/src/handler/update.rs +rust/bin/agent/src/handler/upsert.rs rust/bin/agent/src/main.rs rust/libs/ngt-rs/Cargo.toml rust/libs/ngt-rs/build.rs @@ -1838,8 +1852,6 @@ rust/libs/proto/src/filter.egress.v1.tonic.rs rust/libs/proto/src/filter.ingress.v1.rs rust/libs/proto/src/filter.ingress.v1.tonic.rs rust/libs/proto/src/lib.rs -rust/libs/proto/src/manager.index.v1.rs -rust/libs/proto/src/manager.index.v1.tonic.rs rust/libs/proto/src/mirror.v1.rs rust/libs/proto/src/mirror.v1.tonic.rs rust/libs/proto/src/payload.v1.rs diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index d3f1047a602..9e36ab89186 100755 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -22,8 +22,8 @@ assignees: "" -- Go Version: 1.22.3 +- Go Version: 1.22.5 - Rust Version: 1.77.2 - Docker Version: 20.10.8 -- Kubernetes Version: v1.30.0 -- NGT Version: 2.2.1 +- Kubernetes Version: v1.30.3 +- NGT Version: 2.2.3 diff --git a/.github/ISSUE_TEMPLATE/security_issue_report.md b/.github/ISSUE_TEMPLATE/security_issue_report.md index d99285a63b0..88dd195341a 100644 --- a/.github/ISSUE_TEMPLATE/security_issue_report.md +++ b/.github/ISSUE_TEMPLATE/security_issue_report.md @@ -16,8 +16,8 @@ assignees: "" -- Go Version: 1.22.3 +- Go Version: 1.22.5 - Rust Version: 1.77.2 - Docker Version: 20.10.8 -- Kubernetes Version: v1.30.0 -- NGT Version: 2.2.1 +- Kubernetes Version: v1.30.3 +- NGT Version: 2.2.3 diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 8de61826432..efabc893050 100755 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -16,11 +16,11 @@ -- Go Version: 1.22.3 +- Go Version: 1.22.5 - Rust Version: 1.77.2 - Docker Version: 20.10.8 -- Kubernetes Version: v1.30.0 -- NGT Version: 2.2.1 +- Kubernetes Version: v1.30.3 +- NGT Version: 2.2.3 ### Checklist diff --git a/.github/actions/docker-build/action.yaml b/.github/actions/docker-build/action.yaml index d4f8304efc1..8a152e28ad7 100644 --- a/.github/actions/docker-build/action.yaml +++ b/.github/actions/docker-build/action.yaml @@ -113,7 +113,11 @@ runs: REMOTE="true" \ DOCKER="docker" \ BUILDKIT_INLINE_CACHE=0 \ - DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${LABEL_OPTS} --label org.opencontainers.image.version=${PRIMARY_TAG} --label org.opencontainers.image.title=${TARGET}" \ + DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${LABEL_OPTS} \ + --label org.opencontainers.image.version=${PRIMARY_TAG} \ + --label org.opencontainers.image.title=${TARGET} \ + --label org.opencontainers.image.created=\"$(date --rfc-3339=ns)\" \ + --label org.opencontainers.image.licenses=\"Apache 2.0\"" \ EXTRA_ARGS="${EXTRA_TAGS}" \ TAG="${PRIMARY_TAG}" \ docker/build/${TARGET} diff --git a/.github/actions/e2e-deploy-vald-helm-operator/action.yaml b/.github/actions/e2e-deploy-vald-helm-operator/action.yaml index edc38eccffa..e48f3eac5e8 100644 --- a/.github/actions/e2e-deploy-vald-helm-operator/action.yaml +++ b/.github/actions/e2e-deploy-vald-helm-operator/action.yaml @@ -84,7 +84,13 @@ runs: run: | kubectl apply -f ${VALDRELEASE} - sleep 6 + kubectl get -A vhor + kubectl get -A vr + kubectl get -A -o wide pods + sleep 60 + kubectl get -A vhor + kubectl get -A vr + kubectl get -A -o wide pods kubectl wait --for=condition=ready pod -l ${WAIT_FOR_SELECTOR} --timeout=${WAIT_FOR_TIMEOUT} diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 9b84555b311..669ca129626 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -105,7 +105,7 @@ jobs: run: | make deps/install make format - git checkout go.mod go.sum ./example/client/go.mod ./example/client/go.sum ./rust/Cargo.lock + git checkout go.mod go.sum ./example/client/go.mod ./example/client/go.sum ./rust/Cargo.lock ./dockers - name: Check format and deps difference run: | if git diff --quiet --exit-code; then diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7a443ce3188..b6ef7ae6695 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -61,7 +61,7 @@ jobs: git push origin ${VERSION} echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT - name: Create release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 env: GITHUB_TOKEN: ${{ secrets.DISPATCH_TOKEN }} with: diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index 967b34ed56e..16261386f86 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -38,9 +38,6 @@ jobs: - name: Set Git config run: | git config --global --add safe.directory ${GITHUB_WORKSPACE} - - name: Go build - run: | - GOARCH=${GOARCH} GOOS=${GOOS} go build -mod=readonly ./... - name: Run golangci-lint run: | golangci-lint run --config .golangci.yml \ @@ -49,3 +46,17 @@ jobs: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} REPORTER: github-pr-review LEVEL: warning + go-build: + name: runner / go build + runs-on: ubuntu-latest + needs: [detect-ci-container] + container: + image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG }} + steps: + - uses: actions/checkout@v4 + - name: Set Git config + run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} + - name: Go build + run: | + make binary/build diff --git a/Makefile b/Makefile index 4dfc1b01384..2ad989b1a14 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,17 @@ VERSION ?= $(eval VERSION := $(shell cat versions/VALD_VERSION))$(VERSION) NGT_REPO = github.com/yahoojapan/NGT +NPM_GLOBAL_PREFIX := $(eval NPM_GLOBAL_PREFIX := $(shell npm prefix --location=global))$(NPM_GLOBAL_PREFIX) + +TEST_NOT_IMPL_PLACEHOLDER = NOT IMPLEMENTED BELOW + +TEMP_DIR := $(eval TEMP_DIR := $(shell mktemp -d))$(TEMP_DIR) +USR_LOCAL = /usr/local +BINDIR = $(USR_LOCAL)/bin +LIB_PATH = $(USR_LOCAL)/lib +$(LIB_PATH): + mkdir -p $(LIB_PATH) + GOPRIVATE = $(GOPKG),$(GOPKG)/apis,$(GOPKG)-client-go GOPROXY = "https://proxy.golang.org,direct" GOPATH := $(eval GOPATH := $(shell go env GOPATH))$(GOPATH) @@ -60,17 +71,11 @@ GO_CLEAN_DEPS := true GOTEST_TIMEOUT = 30m CGO_ENABLED = 1 -RUST_HOME ?= /usr/local/lib/rust +RUST_HOME ?= $(LIB_PATH)/rust RUSTUP_HOME ?= $(RUST_HOME)/rustup CARGO_HOME ?= $(RUST_HOME)/cargo RUST_VERSION := $(eval RUST_VERSION := $(shell cat versions/RUST_VERSION))$(RUST_VERSION) -NPM_GLOBAL_PREFIX := $(eval NPM_GLOBAL_PREFIX := $(shell npm prefix --location=global))$(NPM_GLOBAL_PREFIX) - -TEST_NOT_IMPL_PLACEHOLDER = NOT IMPLEMENTED BELOW - -TEMP_DIR := $(eval TEMP_DIR := $(shell mktemp -d))$(TEMP_DIR) - BUF_VERSION := $(eval BUF_VERSION := $(shell cat versions/BUF_VERSION))$(BUF_VERSION) NGT_VERSION := $(eval NGT_VERSION := $(shell cat versions/NGT_VERSION))$(NGT_VERSION) FAISS_VERSION := $(eval FAISS_VERSION := $(shell cat versions/FAISS_VERSION))$(FAISS_VERSION) @@ -101,8 +106,6 @@ SWAP_DEPLOYMENT_TYPE ?= deployment SWAP_IMAGE ?= "" SWAP_TAG ?= latest -BINDIR ?= /usr/local/bin - UNAME := $(eval UNAME := $(shell uname -s))$(UNAME) OS := $(eval OS := $(shell echo $(UNAME) | tr '[:upper:]' '[:lower:]'))$(OS) ARCH := $(eval ARCH := $(shell uname -m))$(ARCH) @@ -239,6 +242,7 @@ GO_SOURCES = $(eval GO_SOURCES := $(shell find \ -not -path '$(ROOTDIR)/hack/benchmark/internal/starter/gateway/*' \ -not -path '$(ROOTDIR)/hack/gorules/*' \ -not -path '$(ROOTDIR)/hack/license/*' \ + -not -path '$(ROOTDIR)/hack/docker/*' \ -not -path '$(ROOTDIR)/hack/swagger/*' \ -not -path '$(ROOTDIR)/hack/tools/*' \ -not -path '$(ROOTDIR)/tests/*' \ @@ -270,6 +274,7 @@ GO_OPTION_SOURCES = $(eval GO_OPTION_SOURCES := $(shell find \ -not -path '$(ROOTDIR)/hack/benchmark/internal/starter/gateway/*' \ -not -path '$(ROOTDIR)/hack/gorules/*' \ -not -path '$(ROOTDIR)/hack/license/*' \ + -not -path '$(ROOTDIR)/hack/docker/*' \ -not -path '$(ROOTDIR)/hack/swagger/*' \ -not -path '$(ROOTDIR)/hack/tools/*' \ -not -path '$(ROOTDIR)/tests/*' \ @@ -324,21 +329,22 @@ SHELL = bash E2E_BIND_HOST ?= 127.0.0.1 E2E_BIND_PORT ?= 8082 -E2E_TIMEOUT ?= 30m E2E_DATASET_NAME ?= fashion-mnist-784-euclidean.hdf5 -E2E_INSERT_COUNT ?= 10000 -E2E_SEARCH_COUNT ?= 1000 -E2E_SEARCH_BY_ID_COUNT ?= 100 E2E_GET_OBJECT_COUNT ?= 10 -E2E_UPDATE_COUNT ?= 10 -E2E_UPSERT_COUNT ?= 10 +E2E_INSERT_COUNT ?= 10000 +E2E_PORTFORWARD_ENABLED ?= true E2E_REMOVE_COUNT ?= 3 -E2E_WAIT_FOR_CREATE_INDEX_DURATION ?= 8m +E2E_SEARCH_BY_ID_COUNT ?= 100 +E2E_SEARCH_COUNT ?= 1000 E2E_TARGET_NAME ?= vald-lb-gateway -E2E_TARGET_POD_NAME ?= $(eval E2E_TARGET_POD_NAME := $(shell kubectl get pods --selector=app=$(E2E_TARGET_NAME) -n $(E2E_TARGET_NAMESPACE) | tail -1 | cut -f1 -d " "))$(E2E_TARGET_POD_NAME) E2E_TARGET_NAMESPACE ?= default +E2E_TARGET_POD_NAME ?= $(eval E2E_TARGET_POD_NAME := $(shell kubectl get pods --selector=app=$(E2E_TARGET_NAME) -n $(E2E_TARGET_NAMESPACE) | tail -1 | cut -f1 -d " "))$(E2E_TARGET_POD_NAME) E2E_TARGET_PORT ?= 8081 -E2E_PORTFORWARD_ENABLED ?= true +E2E_TIMEOUT ?= 30m +E2E_UPDATE_COUNT ?= 10 +E2E_UPSERT_COUNT ?= 10 +E2E_WAIT_FOR_CREATE_INDEX_DURATION ?= 8m +E2E_WAIT_FOR_START_TIMEOUT ?= 10m TEST_RESULT_DIR ?= /tmp @@ -353,14 +359,14 @@ maintainer: ## print all available commands help: @awk '/^[a-zA-Z_0-9%:\\\/-]+:/ { \ - helpMessage = match(lastLine, /^## (.*)/); \ - if (helpMessage) { \ - helpCommand = $$1; \ - helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \ - gsub("\\\\", "", helpCommand); \ - gsub(":+$$", "", helpCommand); \ - printf " \x1b[32;01m%-38s\x1b[0m %s\n", helpCommand, helpMessage; \ - } \ + helpMessage = match(lastLine, /^## (.*)/); \ + if (helpMessage) { \ + helpCommand = $$1; \ + helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \ + gsub("\\\\", "", helpCommand); \ + gsub(":+$$", "", helpCommand); \ + printf " \x1b[32;01m%-38s\x1b[0m %s\n", helpCommand, helpMessage; \ + } \ } \ { lastLine = $$0 }' $(MAKELISTS) | sort -u @printf "\n" @@ -412,6 +418,11 @@ files: license: $(call gen-license,$(ROOTDIR),$(MAINTAINER)) +.PHONY: dockerfile +## generate dockerfiles +dockerfile: + $(call gen-dockerfile,$(ROOTDIR),$(MAINTAINER)) + .PHONY: init ## initialize development environment init: \ @@ -445,6 +456,7 @@ update: \ .PHONY: format ## format go codes format: \ + dockerfile \ license \ format/proto \ format/go \ @@ -455,26 +467,30 @@ format: \ .PHONY: format/go ## run golines, gofumpt, goimports for all go files format/go: \ + crlfmt/install \ golines/install \ gofumpt/install \ strictgoimports/install \ goimports/install find $(ROOTDIR)/ -type d -name .git -prune -o -type f -regex '.*[^\.pb]\.go' -print | xargs -P$(CORES) $(GOBIN)/golines -w -m $(GOLINES_MAX_WIDTH) - find $(ROOTDIR)/ -type d -name .git -prune -o -type f -regex '.*[^\.pb]\.go' -print | xargs -P$(CORES) $(GOBIN)/gofumpt -w find $(ROOTDIR)/ -type d -name .git -prune -o -type f -regex '.*[^\.pb]\.go' -print | xargs -P$(CORES) $(GOBIN)/strictgoimports -w find $(ROOTDIR)/ -type d -name .git -prune -o -type f -regex '.*\.go' -print | xargs -P$(CORES) $(GOBIN)/goimports -w + find $(ROOTDIR)/ -type d -name .git -prune -o -type f -regex '.*\.go' -print | xargs -P$(CORES) $(GOBIN)/crlfmt -w + find $(ROOTDIR)/ -type d -name .git -prune -o -type f -regex '.*[^\.pb]\.go' -print | xargs -P$(CORES) $(GOBIN)/gofumpt -w .PHONY: format/go/test ## run golines, gofumpt, goimports for go test files format/go/test: \ + crlfmt/install \ golines/install \ gofumpt/install \ strictgoimports/install \ goimports/install find $(ROOTDIR) -name '*_test.go' | xargs -P$(CORES) $(GOBIN)/golines -w -m $(GOLINES_MAX_WIDTH) - find $(ROOTDIR) -name '*_test.go' | xargs -P$(CORES) $(GOBIN)/gofumpt -w find $(ROOTDIR) -name '*_test.go' | xargs -P$(CORES) $(GOBIN)/strictgoimports -w find $(ROOTDIR) -name '*_test.go' | xargs -P$(CORES) $(GOBIN)/goimports -w + find $(ROOTDIR) -name '*_test.go' | xargs -P$(CORES) $(GOBIN)/crlfmt -w + find $(ROOTDIR) -name '*_test.go' | xargs -P$(CORES) $(GOBIN)/gofumpt -w .PHONY: format/yaml format/yaml: \ @@ -517,6 +533,7 @@ deps: \ .PHONY: deps/install ## install dependencies deps/install: \ + crlfmt/install \ golines/install \ gofumpt/install \ strictgoimports/install \ @@ -578,12 +595,12 @@ version/telepresence: .PHONY: ngt/install ## install NGT -ngt/install: /usr/local/include/NGT/Capi.h -/usr/local/include/NGT/Capi.h: +ngt/install: $(USR_LOCAL)/include/NGT/Capi.h +$(USR_LOCAL)/include/NGT/Capi.h: git clone --depth 1 --branch v$(NGT_VERSION) https://github.com/yahoojapan/NGT $(TEMP_DIR)/NGT-$(NGT_VERSION) cd $(TEMP_DIR)/NGT-$(NGT_VERSION) && \ cmake -DCMAKE_C_FLAGS="$(CFLAGS)" -DCMAKE_CXX_FLAGS="$(CXXFLAGS)" "$(NGT_EXTRA_FLAGS)" . - make -j -C $(TEMP_DIR)/NGT-$(NGT_VERSION) + make -j$(CORES) -C $(TEMP_DIR)/NGT-$(NGT_VERSION) make install -C $(TEMP_DIR)/NGT-$(NGT_VERSION) cd $(ROOTDIR) rm -rf $(TEMP_DIR)/NGT-$(NGT_VERSION) @@ -591,12 +608,22 @@ ngt/install: /usr/local/include/NGT/Capi.h .PHONY: faiss/install ## install Faiss -faiss/install: /usr/local/lib/libfaiss.so -/usr/local/lib/libfaiss.so: - curl -fsSLO https://github.com/facebookresearch/faiss/archive/v$(FAISS_VERSION).tar.gz - tar zxf v$(FAISS_VERSION).tar.gz -C $(TEMP_DIR)/ +faiss/install: $(LIB_PATH)/libfaiss.a +$(LIB_PATH)/libfaiss.a: + curl -fsSL https://github.com/facebookresearch/faiss/archive/v$(FAISS_VERSION).tar.gz -o $(TEMP_DIR)/v$(FAISS_VERSION).tar.gz + tar zxf $(TEMP_DIR)/v$(FAISS_VERSION).tar.gz -C $(TEMP_DIR)/ cd $(TEMP_DIR)/faiss-$(FAISS_VERSION) && \ - cmake -DFAISS_ENABLE_GPU=OFF -DFAISS_ENABLE_PYTHON=OFF -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -B build . && \ + cmake -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_SHARED_LIBS=OFF \ + -DBUILD_STATIC_EXECS=ON \ + -DBUILD_TESTING=OFF \ + -DCMAKE_C_FLAGS="-fPIC" \ + -DCMAKE_INSTALL_PREFIX=$(USR_LOCAL) \ + -DFAISS_ENABLE_PYTHON=OFF \ + -DFAISS_ENABLE_GPU=OFF \ + -DBLA_VENDOR=OpenBLAS \ + -DCMAKE_EXE_LINKER_FLAGS="-lopenblas -llapack -lgfortran -lm" \ + -B build . && \ make -C build -j faiss && \ make -C build install rm -rf v$(FAISS_VERSION).tar.gz @@ -608,7 +635,11 @@ faiss/install: /usr/local/lib/libfaiss.so lint: \ docs/lint \ files/lint \ - vet + vet \ + go/lint + +.PHONY: go/lint +go/lint: $(call go-lint) .PHONY: vet diff --git a/Makefile.d/build.mk b/Makefile.d/build.mk index 17b0a1c11e9..a7440181c85 100644 --- a/Makefile.d/build.mk +++ b/Makefile.d/build.mk @@ -17,8 +17,6 @@ .PHONY: binary/build ## build all binaries binary/build: \ - cmd/agent/core/faiss/faiss \ - cmd/agent/core/ngt/ngt \ cmd/agent/sidecar/sidecar \ cmd/discoverer/k8s/discoverer \ cmd/gateway/filter/filter \ @@ -28,21 +26,26 @@ binary/build: \ cmd/index/job/creation/index-creation \ cmd/index/job/readreplica/rotate/readreplica-rotate \ cmd/index/job/save/index-save \ + cmd/index/operator/index-operator \ cmd/manager/index/index \ cmd/tools/benchmark/job/job \ cmd/tools/benchmark/operator/operator \ - cmd/index/operator/index-operator + cmd/tools/cli/loadtest/loadtest \ + cmd/agent/core/ngt/ngt \ + cmd/agent/core/faiss/faiss \ + rust/target/debug/agent \ + rust/target/release/agent \ cmd/agent/core/ngt/ngt: \ ngt/install $(eval CGO_ENABLED = 1) - $(call go-build,agent/core/ngt,-linkmode 'external',-static -fPIC -pthread -fopenmp -std=gnu++20 -lstdc++ -lm -z relro -z now $(EXTLDFLAGS), cgo,NGT-$(NGT_VERSION),$@) + $(call go-build,agent/core/ngt,-linkmode 'external',-static -fPIC -pthread -fopenmp -std=gnu++20 -lstdc++ -lm -z relro -z now -flto -march=native -fno-plt -Ofast -fvisibility=hidden -ffp-contract=fast $(EXTLDFLAGS), cgo,NGT-$(NGT_VERSION),$@) cmd/agent/core/faiss/faiss: \ faiss/install $(eval CGO_ENABLED = 1) - $(call go-build,agent/core/faiss,-linkmode 'external',-fPIC -pthread -fopenmp -std=gnu++20 -lstdc++ -lm -z relro -z now, cgo,FAISS-$(FAISS_VERSION),$@) + $(call go-build,agent/core/faiss,-linkmode 'external',-static -fPIC -pthread -fopenmp -std=gnu++20 -lstdc++ -lopenblas -llapack -lgfortran -lm -z relro -z now -flto -march=native -fno-plt -Ofast -fvisibility=hidden -ffp-contract=fast, cgo,FAISS-$(FAISS_VERSION),$@) cmd/agent/sidecar/sidecar: $(eval CGO_ENABLED = 0) @@ -89,12 +92,17 @@ cmd/index/operator/index-operator: $(call go-build,index/operator,,-static,,,$@) cmd/tools/benchmark/job/job: - $(call go-build,tools/benchmark/job,-linkmode 'external',-static -fPIC -pthread -fopenmp -std=gnu++20 -lhdf5 -lhdf5_hl -lm -ldl, cgo,$(HDF5_VERSION),$@) + $(eval CGO_ENABLED = 1) + $(call go-build,tools/benchmark/job,-linkmode 'external',-static -fPIC -pthread -fopenmp -std=gnu++20 -lhdf5 -lhdf5_hl -lsz -laec -lz -lm -ldl, cgo,$(HDF5_VERSION),$@) cmd/tools/benchmark/operator/operator: $(eval CGO_ENABLED = 0) $(call go-build,tools/benchmark/operator,,-static,,,$@) +cmd/tools/cli/loadtest/loadtest: + $(eval CGO_ENABLED = 1) + $(call go-build,tools/cli/loadtest,-linkmode 'external',-static -fPIC -pthread -fopenmp -std=gnu++20 -lhdf5 -lhdf5_hl -lsz -laec -lz -lm -ldl, cgo,$(HDF5_VERSION),$@) + rust/target/release/agent: pushd rust && cargo build -p agent --release && popd @@ -107,16 +115,19 @@ binary/build/zip: \ artifacts/vald-agent-faiss-$(GOOS)-$(GOARCH).zip \ artifacts/vald-agent-ngt-$(GOOS)-$(GOARCH).zip \ artifacts/vald-agent-sidecar-$(GOOS)-$(GOARCH).zip \ + artifacts/vald-benchmark-job-$(GOOS)-$(GOARCH).zip \ + artifacts/vald-benchmark-operator-$(GOOS)-$(GOARCH).zip \ + artifacts/vald-cli-loadtest-$(GOOS)-$(GOARCH).zip \ artifacts/vald-discoverer-k8s-$(GOOS)-$(GOARCH).zip \ artifacts/vald-filter-gateway-$(GOOS)-$(GOARCH).zip \ artifacts/vald-index-correction-$(GOOS)-$(GOARCH).zip \ artifacts/vald-index-creation-$(GOOS)-$(GOARCH).zip \ + artifacts/vald-index-operator-$(GOOS)-$(GOARCH).zip \ artifacts/vald-index-save-$(GOOS)-$(GOARCH).zip \ artifacts/vald-lb-gateway-$(GOOS)-$(GOARCH).zip \ artifacts/vald-manager-index-$(GOOS)-$(GOARCH).zip \ artifacts/vald-mirror-gateway-$(GOOS)-$(GOARCH).zip \ - artifacts/vald-readreplica-rotate-$(GOOS)-$(GOARCH).zip \ - artifacts/vald-index-operator-$(GOOS)-$(GOARCH).zip + artifacts/vald-readreplica-rotate-$(GOOS)-$(GOARCH).zip artifacts/vald-agent-ngt-$(GOOS)-$(GOARCH).zip: cmd/agent/core/ngt/ngt $(call mkdir, $(dir $@)) @@ -154,6 +165,10 @@ artifacts/vald-benchmark-operator-$(GOOS)-$(GOARCH).zip: cmd/tools/benchmark/ope $(call mkdir, $(dir $@)) zip --junk-paths $@ $< +artifacts/vald-cli-loadtest-$(GOOS)-$(GOARCH).zip: cmd/tools/cli/loadtest/loadtest + $(call mkdir, $(dir $@)) + zip --junk-paths $@ $< + artifacts/vald-mirror-gateway-$(GOOS)-$(GOARCH).zip: cmd/gateway/mirror/mirror $(call mkdir, $(dir $@)) zip --junk-paths $@ $< diff --git a/Makefile.d/dependencies.mk b/Makefile.d/dependencies.mk index 8dece00fcad..521af540407 100644 --- a/Makefile.d/dependencies.mk +++ b/Makefile.d/dependencies.mk @@ -47,14 +47,15 @@ go/download: .PHONY: go/deps ## install Go package dependencies -go/deps: +go/deps: \ + update/go sed -i "3s/go [0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?/go $(GO_VERSION)/g" $(ROOTDIR)/hack/go.mod.default if $(GO_CLEAN_DEPS); then \ rm -rf $(ROOTDIR)/vendor \ /go/pkg \ $(GOCACHE) \ $(ROOTDIR)/go.sum \ - $(ROOTDIR)/go.mod ; \ + $(ROOTDIR)/go.mod 2>/dev/null; \ cp $(ROOTDIR)/hack/go.mod.default $(ROOTDIR)/go.mod ; \ GOPRIVATE=$(GOPRIVATE) go mod tidy ; \ go clean -cache -modcache -testcache -i -r ; \ @@ -62,7 +63,7 @@ go/deps: /go/pkg \ $(GOCACHE) \ $(ROOTDIR)/go.sum \ - $(ROOTDIR)/go.mod ; \ + $(ROOTDIR)/go.mod 2>/dev/null; \ cp $(ROOTDIR)/hack/go.mod.default $(ROOTDIR)/go.mod ; \ fi cp $(ROOTDIR)/hack/go.mod.default $(ROOTDIR)/go.mod @@ -76,7 +77,7 @@ go/example/deps: $(GOCACHE) \ $(ROOTDIR)/example/client/vendor \ $(ROOTDIR)/example/client/go.mod \ - $(ROOTDIR)/example/client/go.sum + $(ROOTDIR)/example/client/go.sum 2>/dev/null; \ sed -i "3s/go [0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?/go $(GO_VERSION)/g" $(ROOTDIR)/example/client/go.mod.default cp $(ROOTDIR)/example/client/go.mod.default $(ROOTDIR)/example/client/go.mod cd $(ROOTDIR)/example/client && GOPRIVATE=$(GOPRIVATE) go mod tidy && cd - diff --git a/Makefile.d/docker.mk b/Makefile.d/docker.mk index e466f8b368a..540eca3eb40 100644 --- a/Makefile.d/docker.mk +++ b/Makefile.d/docker.mk @@ -46,10 +46,13 @@ ifeq ($(REMOTE),true) @echo "starting remote build for $(IMAGE):$(TAG)" DOCKER_BUILDKIT=1 $(DOCKER) buildx build \ $(DOCKER_OPTS) \ + --cache-to type=gha,scope=$(TAG)-buildcache,mode=max \ --cache-to type=registry,ref=$(GHCRORG)/$(IMAGE):$(TAG)-buildcache,mode=max \ + --cache-from type=gha,scope=$(TAG)-buildcache \ --cache-from type=registry,ref=$(GHCRORG)/$(IMAGE):$(TAG)-buildcache \ --build-arg BUILDKIT_INLINE_CACHE=$(BUILDKIT_INLINE_CACHE) \ --build-arg GO_VERSION=$(GO_VERSION) \ + --build-arg RUST_VERSION=$(RUST_VERSION) \ --build-arg DISTROLESS_IMAGE=$(DISTROLESS_IMAGE) \ --build-arg DISTROLESS_IMAGE_TAG=$(DISTROLESS_IMAGE_TAG) \ --build-arg MAINTAINER=$(MAINTAINER) \ @@ -66,6 +69,7 @@ else $(DOCKER_OPTS) \ --build-arg BUILDKIT_INLINE_CACHE=$(BUILDKIT_INLINE_CACHE) \ --build-arg GO_VERSION=$(GO_VERSION) \ + --build-arg RUST_VERSION=$(RUST_VERSION) \ --build-arg DISTROLESS_IMAGE=$(DISTROLESS_IMAGE) \ --build-arg DISTROLESS_IMAGE_TAG=$(DISTROLESS_IMAGE_TAG) \ --build-arg MAINTAINER=$(MAINTAINER) \ @@ -229,6 +233,7 @@ docker/name/loadtest: ## build loadtest image docker/build/loadtest: @make DOCKERFILE="$(ROOTDIR)/dockers/tools/cli/loadtest/Dockerfile" \ + DOCKER_OPTS="--build-arg ZLIB_VERSION=$(ZLIB_VERSION) --build-arg HDF5_VERSION=$(HDF5_VERSION)" \ IMAGE=$(LOADTEST_IMAGE) \ docker/build/image diff --git a/Makefile.d/e2e.mk b/Makefile.d/e2e.mk index f2745f84a4a..9971b41bb4a 100644 --- a/Makefile.d/e2e.mk +++ b/Makefile.d/e2e.mk @@ -99,3 +99,44 @@ e2e/maxdim: e2e/sidecar: $(call run-e2e-sidecar-test,-run TestE2EForSidecar) +.PHONY: e2e/actions/run/stream/crud +## run GitHub Actions E2E test (Stream CRUD) +e2e/actions/run/stream/crud: \ + hack/benchmark/assets/dataset/$(E2E_DATASET_NAME) \ + k3d/restart + kubectl wait -n kube-system --for=condition=Available deployment/metrics-server --timeout=$(E2E_WAIT_FOR_START_TIMEOUT) + sleep 2 + kubectl wait -n kube-system --for=condition=Ready pod -l k8s-app=metrics-server --timeout=$(E2E_WAIT_FOR_START_TIMEOUT) + kubectl wait -n kube-system --for=condition=ContainersReady pod -l k8s-app=metrics-server --timeout=$(E2E_WAIT_FOR_START_TIMEOUT) + make k8s/vald/deploy \ + HELM_VALUES=$(ROOTDIR)/.github/helm/values/values-lb.yaml + sleep 3 + kubectl wait --for=condition=Ready pod -l "app=$(LB_GATEWAY_IMAGE)" --timeout=$(E2E_WAIT_FOR_START_TIMEOUT) + kubectl wait --for=condition=ContainersReady pod -l "app=$(LB_GATEWAY_IMAGE)" --timeout=$(E2E_WAIT_FOR_START_TIMEOUT) + kubectl get pods + pod_name=$$(kubectl get pods --selector="app=$(LB_GATEWAY_IMAGE)" | tail -1 | awk '{print $$1}'); \ + echo $$pod_name; \ + make E2E_TARGET_POD_NAME=$$pod_name e2e + make k8s/vald/delete + $(MAKE) k3d/delete + +.PHONY: e2e/actions/run/job +## run GitHub Actions E2E test (jobs) +e2e/actions/run/job: \ + hack/benchmark/assets/dataset/$(E2E_DATASET_NAME) \ + k3d/restart + kubectl wait -n kube-system --for=condition=Available deployment/metrics-server --timeout=$(E2E_WAIT_FOR_START_TIMEOUT) + sleep 2 + kubectl wait -n kube-system --for=condition=Ready pod -l k8s-app=metrics-server --timeout=$(E2E_WAIT_FOR_START_TIMEOUT) + kubectl wait -n kube-system --for=condition=ContainersReady pod -l k8s-app=metrics-server --timeout=$(E2E_WAIT_FOR_START_TIMEOUT) + make k8s/vald/deploy \ + HELM_VALUES=$(ROOTDIR)/.github/helm/values/values-lb.yaml + sleep 3 + kubectl wait --for=condition=Ready pod -l "app=$(LB_GATEWAY_IMAGE)" --timeout=$(E2E_WAIT_FOR_START_TIMEOUT) + kubectl wait --for=condition=ContainersReady pod -l "app=$(LB_GATEWAY_IMAGE)" --timeout=$(E2E_WAIT_FOR_START_TIMEOUT) + kubectl get pods + pod_name=$$(kubectl get pods --selector="app=$(LB_GATEWAY_IMAGE)" | tail -1 | awk '{print $$1}'); \ + echo $$pod_name; \ + make E2E_TARGET_POD_NAME=$$pod_name e2e/index/job/correction + make k8s/vald/delete + $(MAKE) k3d/delete diff --git a/Makefile.d/functions.mk b/Makefile.d/functions.mk index 9b1aa47f8b1..880555e086e 100644 --- a/Makefile.d/functions.mk +++ b/Makefile.d/functions.mk @@ -295,6 +295,23 @@ define gen-license rm -rf $$BIN_PATH endef +define gen-dockerfile + BIN_PATH="$(TEMP_DIR)/vald-dockerfile-gen"; \ + rm -rf $$BIN_PATH; \ + MAINTAINER=$2 \ + GOPRIVATE=$(GOPRIVATE) \ + GOARCH=$(GOARCH) \ + GOOS=$(GOOS) \ + go build -modcacherw \ + -mod=readonly \ + -a \ + -tags "osusergo netgo static_build" \ + -trimpath \ + -o $$BIN_PATH $(ROOTDIR)/hack/docker/gen/main.go; \ + $$BIN_PATH $1; \ + rm -rf $$BIN_PATH +endef + define gen-vald-helm-schema BIN_PATH="$(TEMP_DIR)/vald-helm-schema-gen"; \ rm -rf $$BIN_PATH; \ @@ -333,14 +350,12 @@ define gen-vald-crd endef define update-github-actions - @for ACTION_NAME in $1; do \ + @set -e; for ACTION_NAME in $1; do \ if [ -n "$$ACTION_NAME" ] && [ "$$ACTION_NAME" != "security-and-quality" ]; then \ FILE_NAME=`echo $$ACTION_NAME | tr '/' '_' | tr '-' '_' | tr '[:lower:]' '[:upper:]'`; \ if [ -n "$$FILE_NAME" ]; then \ if [ "$$ACTION_NAME" = "aquasecurity/trivy-action" ] || [ "$$ACTION_NAME" = "machine-learning-apps/actions-chatops" ]; then \ VERSION="master"; \ - elif [ "$$ACTION_NAME" = "softprops/action-gh-release" ]; then \ - VERSION="1.0.0"; \ else \ REPO_NAME=`echo $$ACTION_NAME | cut -d'/' -f1-2`; \ VERSION=`curl -fsSL https://api.github.com/repos/$$REPO_NAME/releases/latest | grep -Po '"tag_name": "\K.*?(?=")' | sed 's/v//g' | sed -E 's/[^0-9.]+//g'`;\ diff --git a/Makefile.d/k3d.mk b/Makefile.d/k3d.mk index 4c0921a0760..7449df203c9 100644 --- a/Makefile.d/k3d.mk +++ b/Makefile.d/k3d.mk @@ -51,4 +51,4 @@ k3d/restart: \ .PHONY: k3d/delete ## stop k3d (kubernetes in docker) cluster k3d/delete: - $(K3D_COMMAND) cluster delete $(K3D_CLUSTER_NAME) + -$(K3D_COMMAND) cluster delete $(K3D_CLUSTER_NAME) diff --git a/Makefile.d/k8s.mk b/Makefile.d/k8s.mk index 51af5d2d14e..469cdc74d14 100644 --- a/Makefile.d/k8s.mk +++ b/Makefile.d/k8s.mk @@ -5,7 +5,7 @@ # 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 +# 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, @@ -18,7 +18,7 @@ JAEGER_OPERATOR_WAIT_DURATION := 0 MIRROR01_NAMESPACE = vald-01 MIRROR02_NAMESPACE = vald-02 MIRROR03_NAMESPACE = vald-03 -MIRROR_APP_NAME = vald-mirror-gateway +MIRROR_APP_NAME = vald-mirror-gateway .PHONY: k8s/manifest/clean ## clean k8s manifests @@ -58,15 +58,15 @@ k8s/manifest/update: \ ## clean k8s manifests for helm-operator k8s/manifest/helm-operator/clean: rm -rf \ - k8s/operator/helm + k8s/operator/helm .PHONY: k8s/manifest/helm-operator/update ## update k8s manifests for helm-operatorusing helm templates k8s/manifest/helm-operator/update: \ k8s/manifest/helm-operator/clean helm template \ - --output-dir $(TEMP_DIR) \ - charts/vald-helm-operator + --output-dir $(TEMP_DIR) \ + charts/vald-helm-operator mkdir -p k8s/operator mv $(TEMP_DIR)/vald-helm-operator/templates k8s/operator/helm rm -rf $(TEMP_DIR) @@ -76,15 +76,15 @@ k8s/manifest/helm-operator/update: \ ## clean k8s manifests for benchmark-operator k8s/manifest/benchmark-operator/clean: rm -rf \ - k8s/tools/benchmark/operator + k8s/tools/benchmark/operator .PHONY: k8s/manifest/benchmark-operator/update ## update k8s manifests for benchmark-operator using helm templates k8s/manifest/benchmark-operator/update: \ k8s/manifest/benchmark-operator/clean helm template \ - --output-dir $(TEMP_DIR) \ - charts/vald-benchmark-operator + --output-dir $(TEMP_DIR) \ + charts/vald-benchmark-operator mkdir -p k8s/tools/benchmark mv $(TEMP_DIR)/vald-benchmark-operator/templates k8s/tools/benchmark/operator rm -rf $(TEMP_DIR) @@ -94,15 +94,15 @@ k8s/manifest/benchmark-operator/update: \ ## clean k8s manifests for readreplica k8s/manifest/readreplica/clean: rm -rf \ - k8s/readreplica + k8s/readreplica .PHONY: k8s/manifest/readreplica/update ## update k8s manifests for readreplica using helm templates k8s/manifest/readreplica/update: \ k8s/manifest/readreplica/clean helm template \ - --output-dir $(TEMP_DIR) \ - charts/vald-readreplica + --output-dir $(TEMP_DIR) \ + charts/vald-readreplica mv $(TEMP_DIR)/vald-readreplica/templates k8s/readreplica rm -rf $(TEMP_DIR) @@ -110,22 +110,22 @@ k8s/manifest/readreplica/update: \ ## deploy vald sample cluster to k8s k8s/vald/deploy: helm template \ - --values $(HELM_VALUES) \ - --set defaults.image.tag=$(VERSION) \ - --set agent.image.repository=$(CRORG)/$(AGENT_NGT_IMAGE) \ - --set agent.sidecar.image.repository=$(CRORG)/$(AGENT_SIDECAR_IMAGE) \ - --set discoverer.image.repository=$(CRORG)/$(DISCOVERER_IMAGE) \ - --set gateway.filter.image.repository=$(CRORG)/$(FILTER_GATEWAY_IMAGE) \ - --set gateway.lb.image.repository=$(CRORG)/$(LB_GATEWAY_IMAGE) \ - --set gateway.mirror.image.repository=$(CRORG)/$(MIRROR_GATEWAY_IMAGE) \ - --set manager.index.image.repository=$(CRORG)/$(MANAGER_INDEX_IMAGE) \ - --set manager.index.creator.image.repository=$(CRORG)/$(INDEX_CREATION_IMAGE) \ - --set manager.index.saver.image.repository=$(CRORG)/$(INDEX_SAVE_IMAGE) \ + --values $(HELM_VALUES) \ + --set defaults.image.tag=$(VERSION) \ + --set agent.image.repository=$(CRORG)/$(AGENT_NGT_IMAGE) \ + --set agent.sidecar.image.repository=$(CRORG)/$(AGENT_SIDECAR_IMAGE) \ + --set discoverer.image.repository=$(CRORG)/$(DISCOVERER_IMAGE) \ + --set gateway.filter.image.repository=$(CRORG)/$(FILTER_GATEWAY_IMAGE) \ + --set gateway.lb.image.repository=$(CRORG)/$(LB_GATEWAY_IMAGE) \ + --set gateway.mirror.image.repository=$(CRORG)/$(MIRROR_GATEWAY_IMAGE) \ + --set manager.index.image.repository=$(CRORG)/$(MANAGER_INDEX_IMAGE) \ + --set manager.index.creator.image.repository=$(CRORG)/$(INDEX_CREATION_IMAGE) \ + --set manager.index.saver.image.repository=$(CRORG)/$(INDEX_SAVE_IMAGE) \ --set manager.index.operator.image.repository=$(CRORG)/$(INDEX_OPERATOR_IMAGE) \ - $(HELM_EXTRA_OPTIONS) \ - --include-crds \ - --output-dir $(TEMP_DIR) \ - charts/vald + $(HELM_EXTRA_OPTIONS) \ + --include-crds \ + --output-dir $(TEMP_DIR) \ + charts/vald @echo "Permitting error because there's some cases nothing to apply" kubectl apply -f $(TEMP_DIR)/vald/templates/manager/index || true kubectl apply -f $(TEMP_DIR)/vald/templates/agent || true @@ -148,19 +148,19 @@ k8s/vald/deploy: ## delete vald sample cluster from k8s k8s/vald/delete: helm template \ - --values $(HELM_VALUES) \ - --set defaults.image.tag=$(VERSION) \ - --set agent.image.repository=$(CRORG)/$(AGENT_NGT_IMAGE) \ - --set agent.sidecar.image.repository=$(CRORG)/$(AGENT_SIDECAR_IMAGE) \ - --set discoverer.image.repository=$(CRORG)/$(DISCOVERER_IMAGE) \ - --set gateway.filter.image.repository=$(CRORG)/$(FILTER_GATEWAY_IMAGE) \ - --set gateway.lb.image.repository=$(CRORG)/$(LB_GATEWAY_IMAGE) \ - --set gateway.mirror.image.repository=$(CRORG)/$(MIRROR_GATEWAY_IMAGE) \ - --set manager.index.image.repository=$(CRORG)/$(MANAGER_INDEX_IMAGE) \ + --values $(HELM_VALUES) \ + --set defaults.image.tag=$(VERSION) \ + --set agent.image.repository=$(CRORG)/$(AGENT_NGT_IMAGE) \ + --set agent.sidecar.image.repository=$(CRORG)/$(AGENT_SIDECAR_IMAGE) \ + --set discoverer.image.repository=$(CRORG)/$(DISCOVERER_IMAGE) \ + --set gateway.filter.image.repository=$(CRORG)/$(FILTER_GATEWAY_IMAGE) \ + --set gateway.lb.image.repository=$(CRORG)/$(LB_GATEWAY_IMAGE) \ + --set gateway.mirror.image.repository=$(CRORG)/$(MIRROR_GATEWAY_IMAGE) \ + --set manager.index.image.repository=$(CRORG)/$(MANAGER_INDEX_IMAGE) \ --set manager.index.operator.image.repository=$(CRORG)/$(INDEX_OPERATOR_IMAGE) \ - --include-crds \ - --output-dir $(TEMP_DIR) \ - charts/vald + --include-crds \ + --output-dir $(TEMP_DIR) \ + charts/vald kubectl delete -f $(TEMP_DIR)/vald/templates/gateway/mirror || true kubectl delete -f $(TEMP_DIR)/vald/templates/index/operator || true kubectl delete -f $(TEMP_DIR)/vald/templates/index/job/readreplica/rotate || true @@ -188,11 +188,11 @@ k8s/multi/vald/deploy: helm install vald-cluster-01 charts/vald \ -f $(ROOTDIR)/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml \ -f $(ROOTDIR)/charts/vald/values/multi-vald/dev-vald-01.yaml \ - -n $(MIRROR01_NAMESPACE) + -n $(MIRROR01_NAMESPACE) helm install vald-cluster-02 charts/vald \ -f $(ROOTDIR)/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml \ -f $(ROOTDIR)/charts/vald/values/multi-vald/dev-vald-02.yaml \ - -n $(MIRROR02_NAMESPACE) + -n $(MIRROR02_NAMESPACE) helm install vald-cluster-03 charts/vald \ -f $(ROOTDIR)/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml \ -f $(ROOTDIR)/charts/vald/values/multi-vald/dev-vald-03.yaml \ @@ -215,11 +215,11 @@ k8s/multi/vald/delete: ## deploy vald-helm-operator to k8s k8s/vald-helm-operator/deploy: helm template \ - --output-dir $(TEMP_DIR) \ - --set image.tag=$(VERSION) \ - $(HELM_EXTRA_OPTIONS) \ - --include-crds \ - charts/vald-helm-operator + --output-dir $(TEMP_DIR) \ + --set image.tag=$(VERSION) \ + $(HELM_EXTRA_OPTIONS) \ + --include-crds \ + charts/vald-helm-operator kubectl create -f $(TEMP_DIR)/vald-helm-operator/crds/valdrelease.yaml kubectl create -f $(TEMP_DIR)/vald-helm-operator/crds/valdhelmoperatorrelease.yaml kubectl apply -f $(TEMP_DIR)/vald-helm-operator/templates @@ -230,10 +230,10 @@ k8s/vald-helm-operator/deploy: ## delete vald-helm-operator from k8s k8s/vald-helm-operator/delete: helm template \ - --output-dir $(TEMP_DIR) \ - --set image.tag=$(VERSION) \ - --include-crds \ - charts/vald-helm-operator + --output-dir $(TEMP_DIR) \ + --set image.tag=$(VERSION) \ + --include-crds \ + charts/vald-helm-operator kubectl delete -f $(TEMP_DIR)/vald-helm-operator/templates kubectl wait --for=delete pod -l name=vald-helm-operator --timeout=600s kubectl delete -f $(TEMP_DIR)/vald-helm-operator/crds @@ -243,19 +243,19 @@ k8s/vald-helm-operator/delete: ## deploy vald-readreplica to k8s k8s/vald-readreplica/deploy: helm template \ - --values $(HELM_VALUES) \ - --set defaults.image.tag=$(VERSION) \ - --set agent.image.repository=$(CRORG)/$(AGENT_NGT_IMAGE) \ - --set agent.sidecar.image.repository=$(CRORG)/$(AGENT_SIDECAR_IMAGE) \ - --set discoverer.image.repository=$(CRORG)/$(DISCOVERER_IMAGE) \ - --set gateway.filter.image.repository=$(CRORG)/$(FILTER_GATEWAY_IMAGE) \ - --set gateway.lb.image.repository=$(CRORG)/$(LB_GATEWAY_IMAGE) \ - --set manager.index.image.repository=$(CRORG)/$(MANAGER_INDEX_IMAGE) \ - --set manager.index.creator.image.repository=$(CRORG)/$(INDEX_CREATION_IMAGE) \ - --set manager.index.saver.image.repository=$(CRORG)/$(INDEX_SAVE_IMAGE) \ - $(HELM_EXTRA_OPTIONS) \ - --output-dir $(TEMP_DIR) \ - charts/vald-readreplica + --values $(HELM_VALUES) \ + --set defaults.image.tag=$(VERSION) \ + --set agent.image.repository=$(CRORG)/$(AGENT_NGT_IMAGE) \ + --set agent.sidecar.image.repository=$(CRORG)/$(AGENT_SIDECAR_IMAGE) \ + --set discoverer.image.repository=$(CRORG)/$(DISCOVERER_IMAGE) \ + --set gateway.filter.image.repository=$(CRORG)/$(FILTER_GATEWAY_IMAGE) \ + --set gateway.lb.image.repository=$(CRORG)/$(LB_GATEWAY_IMAGE) \ + --set manager.index.image.repository=$(CRORG)/$(MANAGER_INDEX_IMAGE) \ + --set manager.index.creator.image.repository=$(CRORG)/$(INDEX_CREATION_IMAGE) \ + --set manager.index.saver.image.repository=$(CRORG)/$(INDEX_SAVE_IMAGE) \ + $(HELM_EXTRA_OPTIONS) \ + --output-dir $(TEMP_DIR) \ + charts/vald-readreplica kubectl apply -f $(TEMP_DIR)/vald-readreplica/templates sleep 2 kubectl wait --for=condition=ready pod -l app.kubernetes.io/name=vald-readreplica --timeout=600s @@ -264,16 +264,16 @@ k8s/vald-readreplica/deploy: ## delete vald-helm-operator from k8s k8s/vald-readreplica/delete: helm template \ - --values $(HELM_VALUES) \ - --set defaults.image.tag=$(VERSION) \ - --set agent.image.repository=$(CRORG)/$(AGENT_NGT_IMAGE) \ - --set agent.sidecar.image.repository=$(CRORG)/$(AGENT_SIDECAR_IMAGE) \ - --set discoverer.image.repository=$(CRORG)/$(DISCOVERER_IMAGE) \ - --set gateway.filter.image.repository=$(CRORG)/$(FILTER_GATEWAY_IMAGE) \ - --set gateway.lb.image.repository=$(CRORG)/$(LB_GATEWAY_IMAGE) \ - --set manager.index.image.repository=$(CRORG)/$(MANAGER_INDEX_IMAGE) \ - --output-dir $(TEMP_DIR) \ - charts/vald-readreplica + --values $(HELM_VALUES) \ + --set defaults.image.tag=$(VERSION) \ + --set agent.image.repository=$(CRORG)/$(AGENT_NGT_IMAGE) \ + --set agent.sidecar.image.repository=$(CRORG)/$(AGENT_SIDECAR_IMAGE) \ + --set discoverer.image.repository=$(CRORG)/$(DISCOVERER_IMAGE) \ + --set gateway.filter.image.repository=$(CRORG)/$(FILTER_GATEWAY_IMAGE) \ + --set gateway.lb.image.repository=$(CRORG)/$(LB_GATEWAY_IMAGE) \ + --set manager.index.image.repository=$(CRORG)/$(MANAGER_INDEX_IMAGE) \ + --output-dir $(TEMP_DIR) \ + charts/vald-readreplica kubectl delete -f $(TEMP_DIR)/vald-readreplica/templates kubectl wait --for=delete pod -l app.kubernetes.io/name=vald-readreplica --timeout=600s rm -rf $(TEMP_DIR) @@ -284,9 +284,9 @@ k8s/vr/deploy: \ yq/install \ k8s/metrics/metrics-server/deploy yq eval \ - '{"apiVersion": "vald.vdaas.org/v1", "kind": "ValdRelease", "metadata":{"name":"vald-cluster"}, "spec": .}' \ - $(HELM_VALUES) \ - | kubectl apply -f - + '{"apiVersion": "vald.vdaas.org/v1", "kind": "ValdRelease", "metadata":{"name":"vald-cluster"}, "spec": .}' \ + $(HELM_VALUES) \ + | kubectl apply -f - .PHONY: k8s/vr/delete ## delete ValdRelease resource from k8s @@ -298,10 +298,10 @@ k8s/vr/delete: \ ## deploy vald-benchmark-operator to k8s k8s/vald-benchmark-operator/deploy: helm template \ - --output-dir $(TEMP_DIR) \ - --set image.tag=${VERSION} \ - --include-crds \ - charts/vald-benchmark-operator + --output-dir $(TEMP_DIR) \ + --set image.tag=${VERSION} \ + --include-crds \ + charts/vald-benchmark-operator kubectl create -f $(TEMP_DIR)/vald-benchmark-operator/crds/valdbenchmarkjob.yaml kubectl create -f $(TEMP_DIR)/vald-benchmark-operator/crds/valdbenchmarkscenario.yaml kubectl create -f $(TEMP_DIR)/vald-benchmark-operator/crds/valdbenchmarkoperatorrelease.yaml @@ -313,10 +313,10 @@ k8s/vald-benchmark-operator/deploy: ## delete vald-benchmark-operator from k8s k8s/vald-benchmark-operator/delete: helm template \ - --output-dir $(TEMP_DIR) \ - --set image.tag=${VERSION} \ - --include-crds \ - charts/vald-benchmark-operator + --output-dir $(TEMP_DIR) \ + --set image.tag=${VERSION} \ + --include-crds \ + charts/vald-benchmark-operator kubectl delete -f $(TEMP_DIR)/vald-benchmark-operator/templates kubectl wait --for=delete pod -l name=vald-benchmark-operator --timeout=600s kubectl delete -f $(TEMP_DIR)/vald-benchmark-operator/crds @@ -357,15 +357,14 @@ k8s/external/minio/delete: .PHONY: k8s/metrics/metrics-server/deploy ## deploy metrics-serrver k8s/metrics/metrics-server/deploy: - kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml - kubectl patch deployment metrics-server -n kube-system -p '{"spec":{"template":{"spec":{"containers":[{"name":"metrics-server","args":["--cert-dir=/tmp", "--secure-port=4443", "--kubelet-insecure-tls","--kubelet-preferred-address-types=InternalIP"]}]}}}}' + helm repo add metrics-server https://kubernetes-sigs.github.io/metrics-server/ + helm install metrics-server metrics-server/metrics-server -n kube-system sleep $(K8S_SLEEP_DURATION_FOR_WAIT_COMMAND) - # kubectl wait -n kube-system --for=condition=ready pod -l k8s-app=metrics-server --timeout=600s .PHONY: k8s/metrics/metrics-server/delete ## delete metrics-serrver k8s/metrics/metrics-server/delete: - kubectl delete -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml + helm uninstall metrics-server --ignore-not-found -n kube-system .PHONY: k8s/metrics/prometheus/deploy ## deploy prometheus @@ -531,8 +530,8 @@ telepresence/install: $(BINDIR)/telepresence $(BINDIR)/telepresence: mkdir -p $(BINDIR) cd $(TEMP_DIR) \ - && curl -fsSL "https://app.getambassador.io/download/tel2oss/releases/download/v$(TELEPRESENCE_VERSION)/telepresence-$(OS)-$(subst x86_64,amd64,$(shell echo $(ARCH) | tr '[:upper:]' '[:lower:]'))" -o $(BINDIR)/telepresence \ - && chmod a+x $(BINDIR)/telepresence + && curl -fsSL "https://app.getambassador.io/download/tel2oss/releases/download/v$(TELEPRESENCE_VERSION)/telepresence-$(OS)-$(subst x86_64,amd64,$(shell echo $(ARCH) | tr '[:upper:]' '[:lower:]'))" -o $(BINDIR)/telepresence \ + && chmod a+x $(BINDIR)/telepresence .PHONY: telepresence/swap/agent-ngt ## swap agent-ngt deployment using telepresence @@ -566,5 +565,5 @@ kubelinter/install: $(BINDIR)/kube-linter $(BINDIR)/kube-linter: mkdir -p $(BINDIR) cd $(TEMP_DIR) \ - && curl -fsSL https://github.com/stackrox/kube-linter/releases/download/$(KUBELINTER_VERSION)/kube-linter-$(OS) -o $(BINDIR)/kube-linter \ - && chmod a+x $(BINDIR)/kube-linter + && curl -fsSL https://github.com/stackrox/kube-linter/releases/download/$(KUBELINTER_VERSION)/kube-linter-$(OS) -o $(BINDIR)/kube-linter \ + && chmod a+x $(BINDIR)/kube-linter diff --git a/Makefile.d/proto.mk b/Makefile.d/proto.mk index 8598ef246db..dd0ff92f1a3 100644 --- a/Makefile.d/proto.mk +++ b/Makefile.d/proto.mk @@ -59,3 +59,4 @@ proto/gen: \ find $(ROOTDIR)/apis/grpc/* -name '*.go' | xargs -P$(CORES) sed -i -E "s%google.golang.org/grpc/status%github.com/vdaas/vald/internal/net/grpc/status%g" find $(ROOTDIR)/apis/grpc/* -name '*.go' | xargs -P$(CORES) sed -i -E "s%\"io\"%\"github.com/vdaas/vald/internal/io\"%g" find $(ROOTDIR)/apis/grpc/* -name '*.go' | xargs -P$(CORES) sed -i -E "s%\"sync\"%\"github.com/vdaas/vald/internal/sync\"%g" + find $(ROOTDIR)/apis/grpc/* -name '*.go' | xargs -P$(CORES) sed -i -E "s%any%any%g" diff --git a/Makefile.d/tools.mk b/Makefile.d/tools.mk index ac7838a877d..59b06c60d77 100644 --- a/Makefile.d/tools.mk +++ b/Makefile.d/tools.mk @@ -46,9 +46,16 @@ golines/install: $(GOBIN)/golines $(GOBIN)/golines: $(call go-install, github.com/segmentio/golines) +.PHONY: crlfmt/install +crlfmt/install: $(GOBIN)/crlfmt + +$(GOBIN)/crlfmt: + $(call go-install, github.com/cockroachdb/crlfmt) + .PHONY: prettier/install prettier/install: $(BINDIR)/prettier $(BINDIR)/prettier: + npm config set registry http://registry.npmjs.org/ type prettier || npm install -g prettier .PHONY: reviewdog/install @@ -81,7 +88,7 @@ textlint/ci/install: cspell/install: $(NPM_GLOBAL_PREFIX)/bin/cspell $(NPM_GLOBAL_PREFIX)/bin/cspell: - npm install -g git+https://github.com/streetsidesoftware/cspell-cli + npm install -g cspell@latest .PHONY: buf/install buf/install: $(BINDIR)/buf @@ -164,3 +171,57 @@ rust/install: $(CARGO_HOME)/bin/cargo $(CARGO_HOME)/bin/cargo: curl --proto '=https' --tlsv1.2 -fsSL https://sh.rustup.rs | CARGO_HOME=${CARGO_HOME} RUSTUP_HOME=${RUSTUP_HOME} sh -s -- --default-toolchain $(RUST_VERSION) -y source "${CARGO_HOME}/env" + +.PHONY: zlib/install +zlib/install: $(LIB_PATH)/libz.a + +$(LIB_PATH)/libz.a: $(LIB_PATH) + curl -fsSL https://github.com/madler/zlib/releases/download/v$(ZLIB_VERSION)/zlib-$(ZLIB_VERSION).tar.gz -o $(TEMP_DIR)/zlib-$(ZLIB_VERSION).tar.gz \ + && mkdir -p $(TEMP_DIR)/zlib \ + && tar -xzvf $(TEMP_DIR)/zlib-$(ZLIB_VERSION).tar.gz -C $(TEMP_DIR)/zlib --strip-components 1 \ + && cd $(TEMP_DIR)/zlib \ + && mkdir -p build \ + && cd build \ + && cmake -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_SHARED_LIBS=OFF \ + -DBUILD_STATIC_EXECS=ON \ + -DBUILD_TESTING=OFF \ + -DCMAKE_C_FLAGS="-fPIC" \ + -DCMAKE_INSTALL_PREFIX=$(USR_LOCAL) \ + -DZLIB_BUILD_SHARED=OFF \ + -DZLIB_BUILD_STATIC=ON \ + -DZLIB_USE_STATIC_LIBS=ON \ + -DZLIB_COMPAT=ON \ + .. \ + && make -j$(CORES) \ + && make install \ + && cd $(ROOTDIR) \ + && rm -rf $(TEMP_DIR)/zlib-$(ZLIB_VERSION).tar.gz $(TEMP_DIR)/zlib $(LIB_PATH)/libz.s* + +.PHONY: hdf5/install +hdf5/install: $(LIB_PATH)/libhdf5.a + +$(LIB_PATH)/libhdf5.a: $(LIB_PATH) \ + zlib/install + mkdir -p $(TEMP_DIR)/hdf5 \ + && curl -fsSL https://github.com/HDFGroup/hdf5/releases/download/$(HDF5_VERSION)/hdf5.tar.gz -o $(TEMP_DIR)/hdf5.tar.gz \ + && tar -xzvf $(TEMP_DIR)/hdf5.tar.gz -C $(TEMP_DIR)/hdf5 --strip-components 2 \ + && mkdir $(TEMP_DIR)/hdf5/build \ + && cd $(TEMP_DIR)/hdf5/build \ + && cmake -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_SHARED_LIBS=OFF \ + -DBUILD_STATIC_EXECS=ON \ + -DBUILD_TESTING=OFF \ + -DCMAKE_INSTALL_PREFIX=$(USR_LOCAL) \ + -DH5_ZLIB_INCLUDE_DIR=$(USR_LOCAL)/include \ + -DH5_ZLIB_LIBRARY=$(LIB_PATH)/libz.a \ + -DHDF5_BUILD_CPP_LIB=OFF \ + -DHDF5_BUILD_HL_LIB=ON \ + -DHDF5_BUILD_STATIC_EXECS=ON \ + -DHDF5_BUILD_TOOLS=OFF \ + -DHDF5_ENABLE_Z_LIB_SUPPORT=ON \ + .. \ + && make -j$(CORES) \ + && make install \ + && cd $(ROOTDIR) \ + && rm -rf $(TEMP_DIR)/hdf5.tar.gz $(TEMP_DIR)/HDF5_VERSION diff --git a/apis/docs/v1/docs.md b/apis/docs/v1/docs.md index 2a4a50ecb73..8bbcfa7f476 100644 --- a/apis/docs/v1/docs.md +++ b/apis/docs/v1/docs.md @@ -23,6 +23,8 @@ - [Info.IPs](#payload-v1-Info-IPs) - [Info.Index](#payload-v1-Info-Index) - [Info.Index.Count](#payload-v1-Info-Index-Count) + - [Info.Index.Detail](#payload-v1-Info-Index-Detail) + - [Info.Index.Detail.CountsEntry](#payload-v1-Info-Index-Detail-CountsEntry) - [Info.Index.UUID](#payload-v1-Info-Index-UUID) - [Info.Index.UUID.Committed](#payload-v1-Info-Index-UUID-Committed) - [Info.Index.UUID.Uncommitted](#payload-v1-Info-Index-UUID-Uncommitted) @@ -48,7 +50,6 @@ - [Object](#payload-v1-Object) - [Object.Blob](#payload-v1-Object-Blob) - [Object.Distance](#payload-v1-Object-Distance) - - [Object.GetTimestampRequest](#payload-v1-Object-GetTimestampRequest) - [Object.ID](#payload-v1-Object-ID) - [Object.IDs](#payload-v1-Object-IDs) - [Object.List](#payload-v1-Object-List) @@ -62,6 +63,7 @@ - [Object.StreamLocation](#payload-v1-Object-StreamLocation) - [Object.StreamVector](#payload-v1-Object-StreamVector) - [Object.Timestamp](#payload-v1-Object-Timestamp) + - [Object.TimestampRequest](#payload-v1-Object-TimestampRequest) - [Object.Vector](#payload-v1-Object-Vector) - [Object.VectorRequest](#payload-v1-Object-VectorRequest) - [Object.Vectors](#payload-v1-Object-Vectors) @@ -107,8 +109,6 @@ - [Filter](#filter-egress-v1-Filter) - [v1/filter/ingress/ingress_filter.proto](#v1_filter_ingress_ingress_filter-proto) - [Filter](#filter-ingress-v1-Filter) -- [v1/manager/index/index_manager.proto](#v1_manager_index_index_manager-proto) - - [Index](#manager-index-v1-Index) - [v1/mirror/mirror.proto](#v1_mirror_mirror-proto) - [Mirror](#mirror-v1-Mirror) - [v1/rpc/errdetails/error_details.proto](#v1_rpc_errdetails_error_details-proto) @@ -131,6 +131,8 @@ - [Filter](#vald-v1-Filter) - [v1/vald/flush.proto](#v1_vald_flush-proto) - [Flush](#vald-v1-Flush) +- [v1/vald/index.proto](#v1_vald_index-proto) + - [Index](#vald-v1-Index) - [v1/vald/insert.proto](#v1_vald_insert-proto) - [Insert](#vald-v1-Insert) - [v1/vald/object.proto](#v1_vald_object-proto) @@ -294,6 +296,27 @@ Represent the index count message. | indexing | [bool](#bool) | | The indexing index count. | | saving | [bool](#bool) | | The saving index count. | + + +### Info.Index.Detail + +Represent the index count for each Agents message. + +| Field | Type | Label | Description | +| ----------- | -------------------------------------------------------------------------- | -------- | ---------------------------------- | +| counts | [Info.Index.Detail.CountsEntry](#payload-v1-Info-Index-Detail-CountsEntry) | repeated | count infos for each agents | +| replica | [uint32](#uint32) | | index replica of vald cluster | +| live_agents | [uint32](#uint32) | | live agent replica of vald cluster | + + + +### Info.Index.Detail.CountsEntry + +| Field | Type | Label | Description | +| ----- | ------------------------------------------------ | ----- | ----------- | +| key | [string](#string) | | | +| value | [Info.Index.Count](#payload-v1-Info-Index-Count) | | | + ### Info.Index.UUID @@ -554,16 +577,6 @@ Represent the ID and distance pair. | id | [string](#string) | | The vector ID. | | distance | [float](#float) | | The distance. | - - -### Object.GetTimestampRequest - -Represent a request to fetch vector meta data. - -| Field | Type | Label | Description | -| ----- | ---------------------------------- | ----- | ---------------------------- | -| id | [Object.ID](#payload-v1-Object-ID) | | The vector ID to be fetched. | - ### Object.ID @@ -691,6 +704,16 @@ Represent a vector meta data. | id | [string](#string) | | The vector ID. | | timestamp | [int64](#int64) | | timestamp represents when this vector inserted. | + + +### Object.TimestampRequest + +Represent a request to fetch vector meta data. + +| Field | Type | Label | Description | +| ----- | ---------------------------------- | ----- | ---------------------------- | +| id | [Object.ID](#payload-v1-Object-ID) | | The vector ID to be fetched. | + ### Object.Vector @@ -1069,13 +1092,11 @@ AggregationAlgorithm is enum of each aggregation algorithms Represent the agent service. -| Method Name | Request Type | Response Type | Description | -| ------------------ | -------------------------------------------------------------------------------- | ------------------------------------------------------------ | -------------------------------------------------------------------------------------------------- | -| CreateIndex | [.payload.v1.Control.CreateIndexRequest](#payload-v1-Control-CreateIndexRequest) | [.payload.v1.Empty](#payload-v1-Empty) | Represent the creating index RPC. | -| SaveIndex | [.payload.v1.Empty](#payload-v1-Empty) | [.payload.v1.Empty](#payload-v1-Empty) | Represent the saving index RPC. | -| CreateAndSaveIndex | [.payload.v1.Control.CreateIndexRequest](#payload-v1-Control-CreateIndexRequest) | [.payload.v1.Empty](#payload-v1-Empty) | Represent the creating and saving index RPC. | -| IndexInfo | [.payload.v1.Empty](#payload-v1-Empty) | [.payload.v1.Info.Index.Count](#payload-v1-Info-Index-Count) | Represent the RPC to get the agent index information. | -| GetTimestamp | [.payload.v1.Object.GetTimestampRequest](#payload-v1-Object-GetTimestampRequest) | [.payload.v1.Object.Timestamp](#payload-v1-Object-Timestamp) | Represent the RPC to get the vector metadata. This RPC is mainly used for index correction process | +| Method Name | Request Type | Response Type | Description | +| ------------------ | -------------------------------------------------------------------------------- | -------------------------------------- | -------------------------------------------- | +| CreateIndex | [.payload.v1.Control.CreateIndexRequest](#payload-v1-Control-CreateIndexRequest) | [.payload.v1.Empty](#payload-v1-Empty) | Represent the creating index RPC. | +| SaveIndex | [.payload.v1.Empty](#payload-v1-Empty) | [.payload.v1.Empty](#payload-v1-Empty) | Represent the saving index RPC. | +| CreateAndSaveIndex | [.payload.v1.Control.CreateIndexRequest](#payload-v1-Control-CreateIndexRequest) | [.payload.v1.Empty](#payload-v1-Empty) | Represent the creating and saving index RPC. | @@ -1144,22 +1165,6 @@ Represent the ingress filter service. | GenVector | [.payload.v1.Object.Blob](#payload-v1-Object-Blob) | [.payload.v1.Object.Vector](#payload-v1-Object-Vector) | Represent the RPC to generate the vector. | | FilterVector | [.payload.v1.Object.Vector](#payload-v1-Object-Vector) | [.payload.v1.Object.Vector](#payload-v1-Object-Vector) | Represent the RPC to filter the vector. | - - -

Top

- -## v1/manager/index/index_manager.proto - - - -### Index - -Represent the index manager service. - -| Method Name | Request Type | Response Type | Description | -| ----------- | -------------------------------------- | ------------------------------------------------------------ | ----------------------------------------------- | -| IndexInfo | [.payload.v1.Empty](#payload-v1-Empty) | [.payload.v1.Info.Index.Count](#payload-v1-Info-Index-Count) | Represent the RPC to get the index information. | -

Top

@@ -1480,6 +1485,23 @@ Flush service provides ways to flush all indexed vectors. | ----------- | ------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------- | | Flush | [.payload.v1.Flush.Request](#payload-v1-Flush-Request) | [.payload.v1.Info.Index.Count](#payload-v1-Info-Index-Count) | A method to flush all indexed vector. | + + +

Top

+ +## v1/vald/index.proto + + + +### Index + +Represent the index manager service. + +| Method Name | Request Type | Response Type | Description | +| ----------- | -------------------------------------- | -------------------------------------------------------------- | --------------------------------------------------------------- | +| IndexInfo | [.payload.v1.Empty](#payload-v1-Empty) | [.payload.v1.Info.Index.Count](#payload-v1-Info-Index-Count) | Represent the RPC to get the index information. | +| IndexDetail | [.payload.v1.Empty](#payload-v1-Empty) | [.payload.v1.Info.Index.Detail](#payload-v1-Info-Index-Detail) | Represent the RPC to get the index information for each agents. | +

Top

@@ -1510,12 +1532,13 @@ Insert service provides ways to add new vectors. Object service provides ways to fetch indexed vectors. -| Method Name | Request Type | Response Type | Description | -| ---------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | ----------------------------------------------------------- | -| Exists | [.payload.v1.Object.ID](#payload-v1-Object-ID) | [.payload.v1.Object.ID](#payload-v1-Object-ID) | A method to check whether a specified ID is indexed or not. | -| GetObject | [.payload.v1.Object.VectorRequest](#payload-v1-Object-VectorRequest) | [.payload.v1.Object.Vector](#payload-v1-Object-Vector) | A method to fetch a vector. | -| StreamGetObject | [.payload.v1.Object.VectorRequest](#payload-v1-Object-VectorRequest) stream | [.payload.v1.Object.StreamVector](#payload-v1-Object-StreamVector) stream | A method to fetch vectors by bidirectional streaming. | -| StreamListObject | [.payload.v1.Object.List.Request](#payload-v1-Object-List-Request) | [.payload.v1.Object.List.Response](#payload-v1-Object-List-Response) stream | A method to get all the vectors with server streaming | +| Method Name | Request Type | Response Type | Description | +| ---------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| Exists | [.payload.v1.Object.ID](#payload-v1-Object-ID) | [.payload.v1.Object.ID](#payload-v1-Object-ID) | A method to check whether a specified ID is indexed or not. | +| GetObject | [.payload.v1.Object.VectorRequest](#payload-v1-Object-VectorRequest) | [.payload.v1.Object.Vector](#payload-v1-Object-Vector) | A method to fetch a vector. | +| StreamGetObject | [.payload.v1.Object.VectorRequest](#payload-v1-Object-VectorRequest) stream | [.payload.v1.Object.StreamVector](#payload-v1-Object-StreamVector) stream | A method to fetch vectors by bidirectional streaming. | +| StreamListObject | [.payload.v1.Object.List.Request](#payload-v1-Object-List-Request) | [.payload.v1.Object.List.Response](#payload-v1-Object-List-Response) stream | A method to get all the vectors with server streaming | +| GetTimestamp | [.payload.v1.Object.TimestampRequest](#payload-v1-Object-TimestampRequest) | [.payload.v1.Object.Timestamp](#payload-v1-Object-Timestamp) | Represent the RPC to get the vector metadata. This RPC is mainly used for index correction process | diff --git a/apis/grpc/v1/agent/core/agent.go b/apis/grpc/v1/agent/core/agent.go index 5714ae993a4..caf77ef2a27 100644 --- a/apis/grpc/v1/agent/core/agent.go +++ b/apis/grpc/v1/agent/core/agent.go @@ -21,6 +21,4 @@ const ( CreateIndexRPCName = "CreateIndex" SaveIndexRPCName = "SaveIndex" CreateAndSaveIndexRPCName = "CreateAndSaveIndex" - IndexInfoRPCName = "IndexInfo" - GetTimestampRPCName = "GetTimestamp" ) diff --git a/apis/grpc/v1/agent/core/agent.pb.go b/apis/grpc/v1/agent/core/agent.pb.go index 7b70659a66e..61eb7d6243d 100644 --- a/apis/grpc/v1/agent/core/agent.pb.go +++ b/apis/grpc/v1/agent/core/agent.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 +// protoc-gen-go v1.34.2 // protoc (unknown) // source: v1/agent/core/agent.proto @@ -46,66 +46,49 @@ var file_v1_agent_core_agent_proto_rawDesc = []byte{ 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2f, 0x70, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xde, 0x03, 0x0a, - 0x05, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x5f, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xb7, 0x02, 0x0a, + 0x05, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x6b, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x26, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x46, 0x0a, 0x09, 0x53, 0x61, 0x76, 0x65, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x12, 0x11, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, - 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x11, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x13, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x0d, 0x12, 0x0b, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2f, 0x73, 0x61, 0x76, 0x65, 0x12, - 0x6d, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x64, 0x53, 0x61, 0x76, 0x65, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x26, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, - 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x61, 0x6e, 0x64, 0x73, 0x61, 0x76, 0x65, 0x12, 0x51, - 0x0a, 0x09, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x11, 0x2e, 0x70, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1c, - 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, - 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x13, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x0d, 0x12, 0x0b, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2f, 0x69, 0x6e, 0x66, - 0x6f, 0x12, 0x6a, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x12, 0x26, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x12, - 0x0c, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x42, 0x63, 0x0a, - 0x20, 0x6f, 0x72, 0x67, 0x2e, 0x76, 0x64, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x61, 0x6c, 0x64, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x42, 0x09, 0x56, 0x61, 0x6c, 0x64, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x50, 0x01, 0x5a, 0x32, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x64, 0x61, 0x61, 0x73, - 0x2f, 0x76, 0x61, 0x6c, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, - 0x76, 0x31, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x3b, 0x63, 0x6f, - 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x2f, 0x7b, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x73, 0x69, + 0x7a, 0x65, 0x7d, 0x12, 0x46, 0x0a, 0x09, 0x53, 0x61, 0x76, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x12, 0x11, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x1a, 0x11, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x12, 0x0b, + 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2f, 0x73, 0x61, 0x76, 0x65, 0x12, 0x79, 0x0a, 0x12, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x64, 0x53, 0x61, 0x76, 0x65, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x12, 0x26, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x70, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x28, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2f, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x61, 0x6e, 0x64, 0x73, 0x61, 0x76, 0x65, 0x2f, 0x7b, 0x70, 0x6f, 0x6f, 0x6c, + 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x7d, 0x42, 0x63, 0x0a, 0x20, 0x6f, 0x72, 0x67, 0x2e, 0x76, 0x64, + 0x61, 0x61, 0x73, 0x2e, 0x76, 0x61, 0x6c, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x42, 0x09, 0x56, 0x61, 0x6c, 0x64, + 0x41, 0x67, 0x65, 0x6e, 0x74, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x64, 0x61, 0x61, 0x73, 0x2f, 0x76, 0x61, 0x6c, 0x64, 0x2f, 0x61, + 0x70, 0x69, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x67, 0x65, 0x6e, + 0x74, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x3b, 0x63, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } -var file_v1_agent_core_agent_proto_goTypes = []interface{}{ +var file_v1_agent_core_agent_proto_goTypes = []any{ (*payload.Control_CreateIndexRequest)(nil), // 0: payload.v1.Control.CreateIndexRequest (*payload.Empty)(nil), // 1: payload.v1.Empty - (*payload.Object_GetTimestampRequest)(nil), // 2: payload.v1.Object.GetTimestampRequest - (*payload.Info_Index_Count)(nil), // 3: payload.v1.Info.Index.Count - (*payload.Object_Timestamp)(nil), // 4: payload.v1.Object.Timestamp } var file_v1_agent_core_agent_proto_depIdxs = []int32{ 0, // 0: core.v1.Agent.CreateIndex:input_type -> payload.v1.Control.CreateIndexRequest 1, // 1: core.v1.Agent.SaveIndex:input_type -> payload.v1.Empty 0, // 2: core.v1.Agent.CreateAndSaveIndex:input_type -> payload.v1.Control.CreateIndexRequest - 1, // 3: core.v1.Agent.IndexInfo:input_type -> payload.v1.Empty - 2, // 4: core.v1.Agent.GetTimestamp:input_type -> payload.v1.Object.GetTimestampRequest - 1, // 5: core.v1.Agent.CreateIndex:output_type -> payload.v1.Empty - 1, // 6: core.v1.Agent.SaveIndex:output_type -> payload.v1.Empty - 1, // 7: core.v1.Agent.CreateAndSaveIndex:output_type -> payload.v1.Empty - 3, // 8: core.v1.Agent.IndexInfo:output_type -> payload.v1.Info.Index.Count - 4, // 9: core.v1.Agent.GetTimestamp:output_type -> payload.v1.Object.Timestamp - 5, // [5:10] is the sub-list for method output_type - 0, // [0:5] is the sub-list for method input_type + 1, // 3: core.v1.Agent.CreateIndex:output_type -> payload.v1.Empty + 1, // 4: core.v1.Agent.SaveIndex:output_type -> payload.v1.Empty + 1, // 5: core.v1.Agent.CreateAndSaveIndex:output_type -> payload.v1.Empty + 3, // [3:6] is the sub-list for method output_type + 0, // [0:3] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name diff --git a/apis/grpc/v1/agent/core/agent_vtproto.pb.go b/apis/grpc/v1/agent/core/agent_vtproto.pb.go index 706565bbc80..9c2a729b4fa 100644 --- a/apis/grpc/v1/agent/core/agent_vtproto.pb.go +++ b/apis/grpc/v1/agent/core/agent_vtproto.pb.go @@ -48,10 +48,6 @@ type AgentClient interface { SaveIndex(ctx context.Context, in *payload.Empty, opts ...grpc.CallOption) (*payload.Empty, error) // Represent the creating and saving index RPC. CreateAndSaveIndex(ctx context.Context, in *payload.Control_CreateIndexRequest, opts ...grpc.CallOption) (*payload.Empty, error) - // Represent the RPC to get the agent index information. - IndexInfo(ctx context.Context, in *payload.Empty, opts ...grpc.CallOption) (*payload.Info_Index_Count, error) - // Represent the RPC to get the vector metadata. This RPC is mainly used for index correction process - GetTimestamp(ctx context.Context, in *payload.Object_GetTimestampRequest, opts ...grpc.CallOption) (*payload.Object_Timestamp, error) } type agentClient struct { @@ -62,7 +58,9 @@ func NewAgentClient(cc grpc.ClientConnInterface) AgentClient { return &agentClient{cc} } -func (c *agentClient) CreateIndex(ctx context.Context, in *payload.Control_CreateIndexRequest, opts ...grpc.CallOption) (*payload.Empty, error) { +func (c *agentClient) CreateIndex( + ctx context.Context, in *payload.Control_CreateIndexRequest, opts ...grpc.CallOption, +) (*payload.Empty, error) { out := new(payload.Empty) err := c.cc.Invoke(ctx, "/core.v1.Agent/CreateIndex", in, out, opts...) if err != nil { @@ -71,7 +69,9 @@ func (c *agentClient) CreateIndex(ctx context.Context, in *payload.Control_Creat return out, nil } -func (c *agentClient) SaveIndex(ctx context.Context, in *payload.Empty, opts ...grpc.CallOption) (*payload.Empty, error) { +func (c *agentClient) SaveIndex( + ctx context.Context, in *payload.Empty, opts ...grpc.CallOption, +) (*payload.Empty, error) { out := new(payload.Empty) err := c.cc.Invoke(ctx, "/core.v1.Agent/SaveIndex", in, out, opts...) if err != nil { @@ -80,7 +80,9 @@ func (c *agentClient) SaveIndex(ctx context.Context, in *payload.Empty, opts ... return out, nil } -func (c *agentClient) CreateAndSaveIndex(ctx context.Context, in *payload.Control_CreateIndexRequest, opts ...grpc.CallOption) (*payload.Empty, error) { +func (c *agentClient) CreateAndSaveIndex( + ctx context.Context, in *payload.Control_CreateIndexRequest, opts ...grpc.CallOption, +) (*payload.Empty, error) { out := new(payload.Empty) err := c.cc.Invoke(ctx, "/core.v1.Agent/CreateAndSaveIndex", in, out, opts...) if err != nil { @@ -89,24 +91,6 @@ func (c *agentClient) CreateAndSaveIndex(ctx context.Context, in *payload.Contro return out, nil } -func (c *agentClient) IndexInfo(ctx context.Context, in *payload.Empty, opts ...grpc.CallOption) (*payload.Info_Index_Count, error) { - out := new(payload.Info_Index_Count) - err := c.cc.Invoke(ctx, "/core.v1.Agent/IndexInfo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *agentClient) GetTimestamp(ctx context.Context, in *payload.Object_GetTimestampRequest, opts ...grpc.CallOption) (*payload.Object_Timestamp, error) { - out := new(payload.Object_Timestamp) - err := c.cc.Invoke(ctx, "/core.v1.Agent/GetTimestamp", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // AgentServer is the server API for Agent service. // All implementations must embed UnimplementedAgentServer // for forward compatibility @@ -117,10 +101,6 @@ type AgentServer interface { SaveIndex(context.Context, *payload.Empty) (*payload.Empty, error) // Represent the creating and saving index RPC. CreateAndSaveIndex(context.Context, *payload.Control_CreateIndexRequest) (*payload.Empty, error) - // Represent the RPC to get the agent index information. - IndexInfo(context.Context, *payload.Empty) (*payload.Info_Index_Count, error) - // Represent the RPC to get the vector metadata. This RPC is mainly used for index correction process - GetTimestamp(context.Context, *payload.Object_GetTimestampRequest) (*payload.Object_Timestamp, error) mustEmbedUnimplementedAgentServer() } @@ -128,21 +108,19 @@ type AgentServer interface { type UnimplementedAgentServer struct { } -func (UnimplementedAgentServer) CreateIndex(context.Context, *payload.Control_CreateIndexRequest) (*payload.Empty, error) { +func (UnimplementedAgentServer) CreateIndex( + context.Context, *payload.Control_CreateIndexRequest, +) (*payload.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateIndex not implemented") } func (UnimplementedAgentServer) SaveIndex(context.Context, *payload.Empty) (*payload.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method SaveIndex not implemented") } -func (UnimplementedAgentServer) CreateAndSaveIndex(context.Context, *payload.Control_CreateIndexRequest) (*payload.Empty, error) { +func (UnimplementedAgentServer) CreateAndSaveIndex( + context.Context, *payload.Control_CreateIndexRequest, +) (*payload.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateAndSaveIndex not implemented") } -func (UnimplementedAgentServer) IndexInfo(context.Context, *payload.Empty) (*payload.Info_Index_Count, error) { - return nil, status.Errorf(codes.Unimplemented, "method IndexInfo not implemented") -} -func (UnimplementedAgentServer) GetTimestamp(context.Context, *payload.Object_GetTimestampRequest) (*payload.Object_Timestamp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetTimestamp not implemented") -} func (UnimplementedAgentServer) mustEmbedUnimplementedAgentServer() {} // UnsafeAgentServer may be embedded to opt out of forward compatibility for this service. @@ -156,7 +134,9 @@ func RegisterAgentServer(s grpc.ServiceRegistrar, srv AgentServer) { s.RegisterService(&Agent_ServiceDesc, srv) } -func _Agent_CreateIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Agent_CreateIndex_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Control_CreateIndexRequest) if err := dec(in); err != nil { return nil, err @@ -168,13 +148,15 @@ func _Agent_CreateIndex_Handler(srv interface{}, ctx context.Context, dec func(i Server: srv, FullMethod: "/core.v1.Agent/CreateIndex", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(AgentServer).CreateIndex(ctx, req.(*payload.Control_CreateIndexRequest)) } return interceptor(ctx, in, info, handler) } -func _Agent_SaveIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Agent_SaveIndex_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Empty) if err := dec(in); err != nil { return nil, err @@ -186,13 +168,15 @@ func _Agent_SaveIndex_Handler(srv interface{}, ctx context.Context, dec func(int Server: srv, FullMethod: "/core.v1.Agent/SaveIndex", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(AgentServer).SaveIndex(ctx, req.(*payload.Empty)) } return interceptor(ctx, in, info, handler) } -func _Agent_CreateAndSaveIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Agent_CreateAndSaveIndex_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Control_CreateIndexRequest) if err := dec(in); err != nil { return nil, err @@ -204,48 +188,12 @@ func _Agent_CreateAndSaveIndex_Handler(srv interface{}, ctx context.Context, dec Server: srv, FullMethod: "/core.v1.Agent/CreateAndSaveIndex", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(AgentServer).CreateAndSaveIndex(ctx, req.(*payload.Control_CreateIndexRequest)) } return interceptor(ctx, in, info, handler) } -func _Agent_IndexInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(payload.Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AgentServer).IndexInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/core.v1.Agent/IndexInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgentServer).IndexInfo(ctx, req.(*payload.Empty)) - } - return interceptor(ctx, in, info, handler) -} - -func _Agent_GetTimestamp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(payload.Object_GetTimestampRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AgentServer).GetTimestamp(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/core.v1.Agent/GetTimestamp", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgentServer).GetTimestamp(ctx, req.(*payload.Object_GetTimestampRequest)) - } - return interceptor(ctx, in, info, handler) -} - // Agent_ServiceDesc is the grpc.ServiceDesc for Agent service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -265,14 +213,6 @@ var Agent_ServiceDesc = grpc.ServiceDesc{ MethodName: "CreateAndSaveIndex", Handler: _Agent_CreateAndSaveIndex_Handler, }, - { - MethodName: "IndexInfo", - Handler: _Agent_IndexInfo_Handler, - }, - { - MethodName: "GetTimestamp", - Handler: _Agent_GetTimestamp_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "v1/agent/core/agent.proto", diff --git a/apis/grpc/v1/agent/sidecar/sidecar.pb.go b/apis/grpc/v1/agent/sidecar/sidecar.pb.go index ef77866a958..748befbf7bf 100644 --- a/apis/grpc/v1/agent/sidecar/sidecar.pb.go +++ b/apis/grpc/v1/agent/sidecar/sidecar.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 +// protoc-gen-go v1.34.2 // protoc (unknown) // source: v1/agent/sidecar/sidecar.proto @@ -52,7 +52,7 @@ var file_v1_agent_sidecar_sidecar_proto_rawDesc = []byte{ 0x65, 0x63, 0x61, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -var file_v1_agent_sidecar_sidecar_proto_goTypes = []interface{}{} +var file_v1_agent_sidecar_sidecar_proto_goTypes = []any{} var file_v1_agent_sidecar_sidecar_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type diff --git a/apis/grpc/v1/discoverer/discoverer.pb.go b/apis/grpc/v1/discoverer/discoverer.pb.go index b3bb0fa3766..be173f22231 100644 --- a/apis/grpc/v1/discoverer/discoverer.pb.go +++ b/apis/grpc/v1/discoverer/discoverer.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 +// protoc-gen-go v1.34.2 // protoc (unknown) // source: v1/discoverer/discoverer.proto @@ -75,7 +75,7 @@ var file_v1_discoverer_discoverer_proto_rawDesc = []byte{ 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -var file_v1_discoverer_discoverer_proto_goTypes = []interface{}{ +var file_v1_discoverer_discoverer_proto_goTypes = []any{ (*payload.Discoverer_Request)(nil), // 0: payload.v1.Discoverer.Request (*payload.Info_Pods)(nil), // 1: payload.v1.Info.Pods (*payload.Info_Nodes)(nil), // 2: payload.v1.Info.Nodes diff --git a/apis/grpc/v1/discoverer/discoverer_vtproto.pb.go b/apis/grpc/v1/discoverer/discoverer_vtproto.pb.go index 33d582002a7..6fc5d237ef8 100644 --- a/apis/grpc/v1/discoverer/discoverer_vtproto.pb.go +++ b/apis/grpc/v1/discoverer/discoverer_vtproto.pb.go @@ -58,7 +58,9 @@ func NewDiscovererClient(cc grpc.ClientConnInterface) DiscovererClient { return &discovererClient{cc} } -func (c *discovererClient) Pods(ctx context.Context, in *payload.Discoverer_Request, opts ...grpc.CallOption) (*payload.Info_Pods, error) { +func (c *discovererClient) Pods( + ctx context.Context, in *payload.Discoverer_Request, opts ...grpc.CallOption, +) (*payload.Info_Pods, error) { out := new(payload.Info_Pods) err := c.cc.Invoke(ctx, "/discoverer.v1.Discoverer/Pods", in, out, opts...) if err != nil { @@ -67,7 +69,9 @@ func (c *discovererClient) Pods(ctx context.Context, in *payload.Discoverer_Requ return out, nil } -func (c *discovererClient) Nodes(ctx context.Context, in *payload.Discoverer_Request, opts ...grpc.CallOption) (*payload.Info_Nodes, error) { +func (c *discovererClient) Nodes( + ctx context.Context, in *payload.Discoverer_Request, opts ...grpc.CallOption, +) (*payload.Info_Nodes, error) { out := new(payload.Info_Nodes) err := c.cc.Invoke(ctx, "/discoverer.v1.Discoverer/Nodes", in, out, opts...) if err != nil { @@ -76,7 +80,9 @@ func (c *discovererClient) Nodes(ctx context.Context, in *payload.Discoverer_Req return out, nil } -func (c *discovererClient) Services(ctx context.Context, in *payload.Discoverer_Request, opts ...grpc.CallOption) (*payload.Info_Services, error) { +func (c *discovererClient) Services( + ctx context.Context, in *payload.Discoverer_Request, opts ...grpc.CallOption, +) (*payload.Info_Services, error) { out := new(payload.Info_Services) err := c.cc.Invoke(ctx, "/discoverer.v1.Discoverer/Services", in, out, opts...) if err != nil { @@ -102,13 +108,19 @@ type DiscovererServer interface { type UnimplementedDiscovererServer struct { } -func (UnimplementedDiscovererServer) Pods(context.Context, *payload.Discoverer_Request) (*payload.Info_Pods, error) { +func (UnimplementedDiscovererServer) Pods( + context.Context, *payload.Discoverer_Request, +) (*payload.Info_Pods, error) { return nil, status.Errorf(codes.Unimplemented, "method Pods not implemented") } -func (UnimplementedDiscovererServer) Nodes(context.Context, *payload.Discoverer_Request) (*payload.Info_Nodes, error) { +func (UnimplementedDiscovererServer) Nodes( + context.Context, *payload.Discoverer_Request, +) (*payload.Info_Nodes, error) { return nil, status.Errorf(codes.Unimplemented, "method Nodes not implemented") } -func (UnimplementedDiscovererServer) Services(context.Context, *payload.Discoverer_Request) (*payload.Info_Services, error) { +func (UnimplementedDiscovererServer) Services( + context.Context, *payload.Discoverer_Request, +) (*payload.Info_Services, error) { return nil, status.Errorf(codes.Unimplemented, "method Services not implemented") } func (UnimplementedDiscovererServer) mustEmbedUnimplementedDiscovererServer() {} @@ -124,7 +136,9 @@ func RegisterDiscovererServer(s grpc.ServiceRegistrar, srv DiscovererServer) { s.RegisterService(&Discoverer_ServiceDesc, srv) } -func _Discoverer_Pods_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Discoverer_Pods_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Discoverer_Request) if err := dec(in); err != nil { return nil, err @@ -136,13 +150,15 @@ func _Discoverer_Pods_Handler(srv interface{}, ctx context.Context, dec func(int Server: srv, FullMethod: "/discoverer.v1.Discoverer/Pods", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(DiscovererServer).Pods(ctx, req.(*payload.Discoverer_Request)) } return interceptor(ctx, in, info, handler) } -func _Discoverer_Nodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Discoverer_Nodes_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Discoverer_Request) if err := dec(in); err != nil { return nil, err @@ -154,13 +170,15 @@ func _Discoverer_Nodes_Handler(srv interface{}, ctx context.Context, dec func(in Server: srv, FullMethod: "/discoverer.v1.Discoverer/Nodes", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(DiscovererServer).Nodes(ctx, req.(*payload.Discoverer_Request)) } return interceptor(ctx, in, info, handler) } -func _Discoverer_Services_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Discoverer_Services_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Discoverer_Request) if err := dec(in); err != nil { return nil, err @@ -172,7 +190,7 @@ func _Discoverer_Services_Handler(srv interface{}, ctx context.Context, dec func Server: srv, FullMethod: "/discoverer.v1.Discoverer/Services", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(DiscovererServer).Services(ctx, req.(*payload.Discoverer_Request)) } return interceptor(ctx, in, info, handler) diff --git a/apis/grpc/v1/filter/egress/egress_filter.pb.go b/apis/grpc/v1/filter/egress/egress_filter.pb.go index 979b819852b..20a683a69ca 100644 --- a/apis/grpc/v1/filter/egress/egress_filter.pb.go +++ b/apis/grpc/v1/filter/egress/egress_filter.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 +// protoc-gen-go v1.34.2 // protoc (unknown) // source: v1/filter/egress/egress_filter.proto @@ -72,7 +72,7 @@ var file_v1_filter_egress_egress_filter_proto_rawDesc = []byte{ 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -var file_v1_filter_egress_egress_filter_proto_goTypes = []interface{}{ +var file_v1_filter_egress_egress_filter_proto_goTypes = []any{ (*payload.Object_Distance)(nil), // 0: payload.v1.Object.Distance (*payload.Object_Vector)(nil), // 1: payload.v1.Object.Vector } diff --git a/apis/grpc/v1/filter/egress/egress_filter_vtproto.pb.go b/apis/grpc/v1/filter/egress/egress_filter_vtproto.pb.go index 40879eb833b..ffe26943c88 100644 --- a/apis/grpc/v1/filter/egress/egress_filter_vtproto.pb.go +++ b/apis/grpc/v1/filter/egress/egress_filter_vtproto.pb.go @@ -56,7 +56,9 @@ func NewFilterClient(cc grpc.ClientConnInterface) FilterClient { return &filterClient{cc} } -func (c *filterClient) FilterDistance(ctx context.Context, in *payload.Object_Distance, opts ...grpc.CallOption) (*payload.Object_Distance, error) { +func (c *filterClient) FilterDistance( + ctx context.Context, in *payload.Object_Distance, opts ...grpc.CallOption, +) (*payload.Object_Distance, error) { out := new(payload.Object_Distance) err := c.cc.Invoke(ctx, "/filter.egress.v1.Filter/FilterDistance", in, out, opts...) if err != nil { @@ -65,7 +67,9 @@ func (c *filterClient) FilterDistance(ctx context.Context, in *payload.Object_Di return out, nil } -func (c *filterClient) FilterVector(ctx context.Context, in *payload.Object_Vector, opts ...grpc.CallOption) (*payload.Object_Vector, error) { +func (c *filterClient) FilterVector( + ctx context.Context, in *payload.Object_Vector, opts ...grpc.CallOption, +) (*payload.Object_Vector, error) { out := new(payload.Object_Vector) err := c.cc.Invoke(ctx, "/filter.egress.v1.Filter/FilterVector", in, out, opts...) if err != nil { @@ -89,10 +93,14 @@ type FilterServer interface { type UnimplementedFilterServer struct { } -func (UnimplementedFilterServer) FilterDistance(context.Context, *payload.Object_Distance) (*payload.Object_Distance, error) { +func (UnimplementedFilterServer) FilterDistance( + context.Context, *payload.Object_Distance, +) (*payload.Object_Distance, error) { return nil, status.Errorf(codes.Unimplemented, "method FilterDistance not implemented") } -func (UnimplementedFilterServer) FilterVector(context.Context, *payload.Object_Vector) (*payload.Object_Vector, error) { +func (UnimplementedFilterServer) FilterVector( + context.Context, *payload.Object_Vector, +) (*payload.Object_Vector, error) { return nil, status.Errorf(codes.Unimplemented, "method FilterVector not implemented") } func (UnimplementedFilterServer) mustEmbedUnimplementedFilterServer() {} @@ -108,7 +116,9 @@ func RegisterFilterServer(s grpc.ServiceRegistrar, srv FilterServer) { s.RegisterService(&Filter_ServiceDesc, srv) } -func _Filter_FilterDistance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Filter_FilterDistance_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Object_Distance) if err := dec(in); err != nil { return nil, err @@ -120,13 +130,15 @@ func _Filter_FilterDistance_Handler(srv interface{}, ctx context.Context, dec fu Server: srv, FullMethod: "/filter.egress.v1.Filter/FilterDistance", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(FilterServer).FilterDistance(ctx, req.(*payload.Object_Distance)) } return interceptor(ctx, in, info, handler) } -func _Filter_FilterVector_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Filter_FilterVector_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Object_Vector) if err := dec(in); err != nil { return nil, err @@ -138,7 +150,7 @@ func _Filter_FilterVector_Handler(srv interface{}, ctx context.Context, dec func Server: srv, FullMethod: "/filter.egress.v1.Filter/FilterVector", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(FilterServer).FilterVector(ctx, req.(*payload.Object_Vector)) } return interceptor(ctx, in, info, handler) diff --git a/apis/grpc/v1/filter/ingress/ingress_filter.pb.go b/apis/grpc/v1/filter/ingress/ingress_filter.pb.go index e6eacd40bbe..e357a893a98 100644 --- a/apis/grpc/v1/filter/ingress/ingress_filter.pb.go +++ b/apis/grpc/v1/filter/ingress/ingress_filter.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 +// protoc-gen-go v1.34.2 // protoc (unknown) // source: v1/filter/ingress/ingress_filter.proto @@ -72,7 +72,7 @@ var file_v1_filter_ingress_ingress_filter_proto_rawDesc = []byte{ 0x74, 0x6f, 0x33, } -var file_v1_filter_ingress_ingress_filter_proto_goTypes = []interface{}{ +var file_v1_filter_ingress_ingress_filter_proto_goTypes = []any{ (*payload.Object_Blob)(nil), // 0: payload.v1.Object.Blob (*payload.Object_Vector)(nil), // 1: payload.v1.Object.Vector } diff --git a/apis/grpc/v1/filter/ingress/ingress_filter_vtproto.pb.go b/apis/grpc/v1/filter/ingress/ingress_filter_vtproto.pb.go index ed24ab43b4b..8b138215059 100644 --- a/apis/grpc/v1/filter/ingress/ingress_filter_vtproto.pb.go +++ b/apis/grpc/v1/filter/ingress/ingress_filter_vtproto.pb.go @@ -56,7 +56,9 @@ func NewFilterClient(cc grpc.ClientConnInterface) FilterClient { return &filterClient{cc} } -func (c *filterClient) GenVector(ctx context.Context, in *payload.Object_Blob, opts ...grpc.CallOption) (*payload.Object_Vector, error) { +func (c *filterClient) GenVector( + ctx context.Context, in *payload.Object_Blob, opts ...grpc.CallOption, +) (*payload.Object_Vector, error) { out := new(payload.Object_Vector) err := c.cc.Invoke(ctx, "/filter.ingress.v1.Filter/GenVector", in, out, opts...) if err != nil { @@ -65,7 +67,9 @@ func (c *filterClient) GenVector(ctx context.Context, in *payload.Object_Blob, o return out, nil } -func (c *filterClient) FilterVector(ctx context.Context, in *payload.Object_Vector, opts ...grpc.CallOption) (*payload.Object_Vector, error) { +func (c *filterClient) FilterVector( + ctx context.Context, in *payload.Object_Vector, opts ...grpc.CallOption, +) (*payload.Object_Vector, error) { out := new(payload.Object_Vector) err := c.cc.Invoke(ctx, "/filter.ingress.v1.Filter/FilterVector", in, out, opts...) if err != nil { @@ -89,10 +93,14 @@ type FilterServer interface { type UnimplementedFilterServer struct { } -func (UnimplementedFilterServer) GenVector(context.Context, *payload.Object_Blob) (*payload.Object_Vector, error) { +func (UnimplementedFilterServer) GenVector( + context.Context, *payload.Object_Blob, +) (*payload.Object_Vector, error) { return nil, status.Errorf(codes.Unimplemented, "method GenVector not implemented") } -func (UnimplementedFilterServer) FilterVector(context.Context, *payload.Object_Vector) (*payload.Object_Vector, error) { +func (UnimplementedFilterServer) FilterVector( + context.Context, *payload.Object_Vector, +) (*payload.Object_Vector, error) { return nil, status.Errorf(codes.Unimplemented, "method FilterVector not implemented") } func (UnimplementedFilterServer) mustEmbedUnimplementedFilterServer() {} @@ -108,7 +116,9 @@ func RegisterFilterServer(s grpc.ServiceRegistrar, srv FilterServer) { s.RegisterService(&Filter_ServiceDesc, srv) } -func _Filter_GenVector_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Filter_GenVector_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Object_Blob) if err := dec(in); err != nil { return nil, err @@ -120,13 +130,15 @@ func _Filter_GenVector_Handler(srv interface{}, ctx context.Context, dec func(in Server: srv, FullMethod: "/filter.ingress.v1.Filter/GenVector", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(FilterServer).GenVector(ctx, req.(*payload.Object_Blob)) } return interceptor(ctx, in, info, handler) } -func _Filter_FilterVector_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Filter_FilterVector_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Object_Vector) if err := dec(in); err != nil { return nil, err @@ -138,7 +150,7 @@ func _Filter_FilterVector_Handler(srv interface{}, ctx context.Context, dec func Server: srv, FullMethod: "/filter.ingress.v1.Filter/FilterVector", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(FilterServer).FilterVector(ctx, req.(*payload.Object_Vector)) } return interceptor(ctx, in, info, handler) diff --git a/apis/grpc/v1/manager/index/index_manager.pb.go b/apis/grpc/v1/manager/index/index_manager.pb.go deleted file mode 100644 index 483c3010cf3..00000000000 --- a/apis/grpc/v1/manager/index/index_manager.pb.go +++ /dev/null @@ -1,103 +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. -// - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc (unknown) -// source: v1/manager/index/index_manager.proto - -package index - -import ( - reflect "reflect" - - payload "github.com/vdaas/vald/apis/grpc/v1/payload" - _ "google.golang.org/genproto/googleapis/api/annotations" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -var File_v1_manager_index_index_manager_proto protoreflect.FileDescriptor - -var file_v1_manager_index_index_manager_proto_rawDesc = []byte{ - 0x0a, 0x24, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x2f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x32, 0x5a, 0x0a, 0x05, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x51, 0x0a, 0x09, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x11, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1c, 0x2e, 0x70, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x12, - 0x0b, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x42, 0x6b, 0x0a, 0x23, - 0x6f, 0x72, 0x67, 0x2e, 0x76, 0x64, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x61, 0x6c, 0x64, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x42, 0x10, 0x56, 0x61, 0x6c, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x64, 0x61, 0x61, 0x73, 0x2f, 0x76, 0x61, 0x6c, 0x64, 0x2f, 0x61, - 0x70, 0x69, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, - 0x67, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} - -var file_v1_manager_index_index_manager_proto_goTypes = []interface{}{ - (*payload.Empty)(nil), // 0: payload.v1.Empty - (*payload.Info_Index_Count)(nil), // 1: payload.v1.Info.Index.Count -} -var file_v1_manager_index_index_manager_proto_depIdxs = []int32{ - 0, // 0: manager.index.v1.Index.IndexInfo:input_type -> payload.v1.Empty - 1, // 1: manager.index.v1.Index.IndexInfo:output_type -> payload.v1.Info.Index.Count - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_v1_manager_index_index_manager_proto_init() } -func file_v1_manager_index_index_manager_proto_init() { - if File_v1_manager_index_index_manager_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v1_manager_index_index_manager_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_v1_manager_index_index_manager_proto_goTypes, - DependencyIndexes: file_v1_manager_index_index_manager_proto_depIdxs, - }.Build() - File_v1_manager_index_index_manager_proto = out.File - file_v1_manager_index_index_manager_proto_rawDesc = nil - file_v1_manager_index_index_manager_proto_goTypes = nil - file_v1_manager_index_index_manager_proto_depIdxs = nil -} diff --git a/apis/grpc/v1/mirror/mirror.pb.go b/apis/grpc/v1/mirror/mirror.pb.go index 9f5826913e1..8a51475751d 100644 --- a/apis/grpc/v1/mirror/mirror.pb.go +++ b/apis/grpc/v1/mirror/mirror.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 +// protoc-gen-go v1.34.2 // protoc (unknown) // source: v1/mirror/mirror.proto @@ -62,7 +62,7 @@ var file_v1_mirror_mirror_proto_rawDesc = []byte{ 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -var file_v1_mirror_mirror_proto_goTypes = []interface{}{ +var file_v1_mirror_mirror_proto_goTypes = []any{ (*payload.Mirror_Targets)(nil), // 0: payload.v1.Mirror.Targets } var file_v1_mirror_mirror_proto_depIdxs = []int32{ diff --git a/apis/grpc/v1/mirror/mirror_vtproto.pb.go b/apis/grpc/v1/mirror/mirror_vtproto.pb.go index 399c385d4bb..4fd44fcf1b0 100644 --- a/apis/grpc/v1/mirror/mirror_vtproto.pb.go +++ b/apis/grpc/v1/mirror/mirror_vtproto.pb.go @@ -54,7 +54,9 @@ func NewMirrorClient(cc grpc.ClientConnInterface) MirrorClient { return &mirrorClient{cc} } -func (c *mirrorClient) Register(ctx context.Context, in *payload.Mirror_Targets, opts ...grpc.CallOption) (*payload.Mirror_Targets, error) { +func (c *mirrorClient) Register( + ctx context.Context, in *payload.Mirror_Targets, opts ...grpc.CallOption, +) (*payload.Mirror_Targets, error) { out := new(payload.Mirror_Targets) err := c.cc.Invoke(ctx, "/mirror.v1.Mirror/Register", in, out, opts...) if err != nil { @@ -76,7 +78,9 @@ type MirrorServer interface { type UnimplementedMirrorServer struct { } -func (UnimplementedMirrorServer) Register(context.Context, *payload.Mirror_Targets) (*payload.Mirror_Targets, error) { +func (UnimplementedMirrorServer) Register( + context.Context, *payload.Mirror_Targets, +) (*payload.Mirror_Targets, error) { return nil, status.Errorf(codes.Unimplemented, "method Register not implemented") } func (UnimplementedMirrorServer) mustEmbedUnimplementedMirrorServer() {} @@ -92,7 +96,9 @@ func RegisterMirrorServer(s grpc.ServiceRegistrar, srv MirrorServer) { s.RegisterService(&Mirror_ServiceDesc, srv) } -func _Mirror_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Mirror_Register_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Mirror_Targets) if err := dec(in); err != nil { return nil, err @@ -104,7 +110,7 @@ func _Mirror_Register_Handler(srv interface{}, ctx context.Context, dec func(int Server: srv, FullMethod: "/mirror.v1.Mirror/Register", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(MirrorServer).Register(ctx, req.(*payload.Mirror_Targets)) } return interceptor(ctx, in, info, handler) diff --git a/apis/grpc/v1/payload/payload.pb.go b/apis/grpc/v1/payload/payload.pb.go index c68b9dd9e43..5925f81550b 100644 --- a/apis/grpc/v1/payload/payload.pb.go +++ b/apis/grpc/v1/payload/payload.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 +// protoc-gen-go v1.34.2 // protoc (unknown) // source: v1/payload/payload.proto @@ -2990,7 +2990,7 @@ func (x *Object_Vector) GetTimestamp() int64 { } // Represent a request to fetch vector meta data. -type Object_GetTimestampRequest struct { +type Object_TimestampRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -2999,8 +2999,8 @@ type Object_GetTimestampRequest struct { Id *Object_ID `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` } -func (x *Object_GetTimestampRequest) Reset() { - *x = Object_GetTimestampRequest{} +func (x *Object_TimestampRequest) Reset() { + *x = Object_TimestampRequest{} if protoimpl.UnsafeEnabled { mi := &file_v1_payload_payload_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -3008,13 +3008,13 @@ func (x *Object_GetTimestampRequest) Reset() { } } -func (x *Object_GetTimestampRequest) String() string { +func (x *Object_TimestampRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Object_GetTimestampRequest) ProtoMessage() {} +func (*Object_TimestampRequest) ProtoMessage() {} -func (x *Object_GetTimestampRequest) ProtoReflect() protoreflect.Message { +func (x *Object_TimestampRequest) ProtoReflect() protoreflect.Message { mi := &file_v1_payload_payload_proto_msgTypes[52] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -3026,12 +3026,12 @@ func (x *Object_GetTimestampRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Object_GetTimestampRequest.ProtoReflect.Descriptor instead. -func (*Object_GetTimestampRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use Object_TimestampRequest.ProtoReflect.Descriptor instead. +func (*Object_TimestampRequest) Descriptor() ([]byte, []int) { return file_v1_payload_payload_proto_rawDescGZIP(), []int{7, 6} } -func (x *Object_GetTimestampRequest) GetId() *Object_ID { +func (x *Object_TimestampRequest) GetId() *Object_ID { if x != nil { return x.Id } @@ -4792,6 +4792,73 @@ func (x *Info_Index_Count) GetSaving() bool { return false } +// Represent the index count for each Agents message. +type Info_Index_Detail struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // count infos for each agents + Counts map[string]*Info_Index_Count `protobuf:"bytes,1,rep,name=counts,proto3" json:"counts,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // index replica of vald cluster + Replica uint32 `protobuf:"varint,2,opt,name=replica,proto3" json:"replica,omitempty"` + // live agent replica of vald cluster + LiveAgents uint32 `protobuf:"varint,3,opt,name=live_agents,json=liveAgents,proto3" json:"live_agents,omitempty"` +} + +func (x *Info_Index_Detail) Reset() { + *x = Info_Index_Detail{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_payload_payload_proto_msgTypes[81] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Info_Index_Detail) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Info_Index_Detail) ProtoMessage() {} + +func (x *Info_Index_Detail) ProtoReflect() protoreflect.Message { + mi := &file_v1_payload_payload_proto_msgTypes[81] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Info_Index_Detail.ProtoReflect.Descriptor instead. +func (*Info_Index_Detail) Descriptor() ([]byte, []int) { + return file_v1_payload_payload_proto_rawDescGZIP(), []int{10, 0, 1} +} + +func (x *Info_Index_Detail) GetCounts() map[string]*Info_Index_Count { + if x != nil { + return x.Counts + } + return nil +} + +func (x *Info_Index_Detail) GetReplica() uint32 { + if x != nil { + return x.Replica + } + return 0 +} + +func (x *Info_Index_Detail) GetLiveAgents() uint32 { + if x != nil { + return x.LiveAgents + } + return 0 +} + // Represent the UUID message. type Info_Index_UUID struct { state protoimpl.MessageState @@ -4802,7 +4869,7 @@ type Info_Index_UUID struct { func (x *Info_Index_UUID) Reset() { *x = Info_Index_UUID{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[81] + mi := &file_v1_payload_payload_proto_msgTypes[82] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4815,7 +4882,7 @@ func (x *Info_Index_UUID) String() string { func (*Info_Index_UUID) ProtoMessage() {} func (x *Info_Index_UUID) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[81] + mi := &file_v1_payload_payload_proto_msgTypes[82] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4828,7 +4895,7 @@ func (x *Info_Index_UUID) ProtoReflect() protoreflect.Message { // Deprecated: Use Info_Index_UUID.ProtoReflect.Descriptor instead. func (*Info_Index_UUID) Descriptor() ([]byte, []int) { - return file_v1_payload_payload_proto_rawDescGZIP(), []int{10, 0, 1} + return file_v1_payload_payload_proto_rawDescGZIP(), []int{10, 0, 2} } // The committed UUID. @@ -4843,7 +4910,7 @@ type Info_Index_UUID_Committed struct { func (x *Info_Index_UUID_Committed) Reset() { *x = Info_Index_UUID_Committed{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[82] + mi := &file_v1_payload_payload_proto_msgTypes[84] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4856,7 +4923,7 @@ func (x *Info_Index_UUID_Committed) String() string { func (*Info_Index_UUID_Committed) ProtoMessage() {} func (x *Info_Index_UUID_Committed) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[82] + mi := &file_v1_payload_payload_proto_msgTypes[84] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4869,7 +4936,7 @@ func (x *Info_Index_UUID_Committed) ProtoReflect() protoreflect.Message { // Deprecated: Use Info_Index_UUID_Committed.ProtoReflect.Descriptor instead. func (*Info_Index_UUID_Committed) Descriptor() ([]byte, []int) { - return file_v1_payload_payload_proto_rawDescGZIP(), []int{10, 0, 1, 0} + return file_v1_payload_payload_proto_rawDescGZIP(), []int{10, 0, 2, 0} } func (x *Info_Index_UUID_Committed) GetUuid() string { @@ -4891,7 +4958,7 @@ type Info_Index_UUID_Uncommitted struct { func (x *Info_Index_UUID_Uncommitted) Reset() { *x = Info_Index_UUID_Uncommitted{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[83] + mi := &file_v1_payload_payload_proto_msgTypes[85] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4904,7 +4971,7 @@ func (x *Info_Index_UUID_Uncommitted) String() string { func (*Info_Index_UUID_Uncommitted) ProtoMessage() {} func (x *Info_Index_UUID_Uncommitted) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[83] + mi := &file_v1_payload_payload_proto_msgTypes[85] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4917,7 +4984,7 @@ func (x *Info_Index_UUID_Uncommitted) ProtoReflect() protoreflect.Message { // Deprecated: Use Info_Index_UUID_Uncommitted.ProtoReflect.Descriptor instead. func (*Info_Index_UUID_Uncommitted) Descriptor() ([]byte, []int) { - return file_v1_payload_payload_proto_rawDescGZIP(), []int{10, 0, 1, 1} + return file_v1_payload_payload_proto_rawDescGZIP(), []int{10, 0, 2, 1} } func (x *Info_Index_UUID_Uncommitted) GetUuid() string { @@ -4942,7 +5009,7 @@ type Mirror_Target struct { func (x *Mirror_Target) Reset() { *x = Mirror_Target{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[86] + mi := &file_v1_payload_payload_proto_msgTypes[88] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4955,7 +5022,7 @@ func (x *Mirror_Target) String() string { func (*Mirror_Target) ProtoMessage() {} func (x *Mirror_Target) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[86] + mi := &file_v1_payload_payload_proto_msgTypes[88] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4998,7 +5065,7 @@ type Mirror_Targets struct { func (x *Mirror_Targets) Reset() { *x = Mirror_Targets{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[87] + mi := &file_v1_payload_payload_proto_msgTypes[89] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5011,7 +5078,7 @@ func (x *Mirror_Targets) String() string { func (*Mirror_Targets) ProtoMessage() {} func (x *Mirror_Targets) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[87] + mi := &file_v1_payload_payload_proto_msgTypes[89] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5299,7 +5366,7 @@ var file_v1_payload_payload_proto_rawDesc = []byte{ 0x69, 0x73, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x12, 0x0a, 0x05, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x1a, - 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xb4, 0x0b, 0x0a, 0x06, 0x4f, + 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xb1, 0x0b, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x1a, 0x75, 0x0a, 0x0d, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, @@ -5329,200 +5396,214 @@ var file_v1_payload_payload_proto_rawDesc = []byte{ 0x18, 0x02, 0x20, 0x03, 0x28, 0x02, 0x42, 0x08, 0xba, 0x48, 0x05, 0x92, 0x01, 0x02, 0x08, 0x02, 0x52, 0x06, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x1a, 0x46, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x49, 0x44, - 0x42, 0x08, 0xba, 0x48, 0x05, 0x92, 0x01, 0x02, 0x08, 0x02, 0x52, 0x02, 0x69, 0x64, 0x1a, 0x42, - 0x0a, 0x09, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x17, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x1a, 0x3e, 0x0a, 0x07, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x33, 0x0a, - 0x07, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, - 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x07, 0x76, 0x65, 0x63, 0x74, 0x6f, - 0x72, 0x73, 0x1a, 0x7c, 0x0a, 0x0c, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x56, 0x65, 0x63, 0x74, - 0x6f, 0x72, 0x12, 0x33, 0x0a, 0x06, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x48, 0x00, 0x52, - 0x06, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x48, 0x00, 0x52, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x1a, 0x3d, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x68, 0x61, 0x70, 0x65, 0x56, 0x65, 0x63, 0x74, 0x6f, - 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, 0x61, - 0x70, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x05, 0x73, 0x68, 0x61, 0x70, 0x65, 0x1a, - 0x37, 0x0a, 0x04, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x1a, 0x74, 0x0a, 0x0a, 0x53, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x2d, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, - 0x31, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x48, 0x00, 0x52, - 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, - 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x44, - 0x0a, 0x08, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, - 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x70, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x03, 0x69, 0x70, 0x73, 0x1a, 0x84, 0x01, 0x0a, 0x0e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4c, - 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4c, 0x6f, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x1a, 0x43, 0x0a, 0x10, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x49, 0x44, 0x42, 0x08, 0xba, + 0x48, 0x05, 0x92, 0x01, 0x02, 0x08, 0x02, 0x52, 0x02, 0x69, 0x64, 0x1a, 0x42, 0x0a, 0x09, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x1a, + 0x3e, 0x0a, 0x07, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x33, 0x0a, 0x07, 0x76, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, + 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x07, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x1a, + 0x7c, 0x0a, 0x0c, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, + 0x33, 0x0a, 0x06, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x06, 0x76, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, + 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x3d, 0x0a, + 0x0d, 0x52, 0x65, 0x73, 0x68, 0x61, 0x70, 0x65, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x16, + 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, + 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, 0x61, 0x70, 0x65, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x05, 0x73, 0x68, 0x61, 0x70, 0x65, 0x1a, 0x37, 0x0a, 0x04, + 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, + 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x1a, 0x74, 0x0a, 0x0a, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, + 0x6c, 0x6f, 0x62, 0x12, 0x2d, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x48, 0x00, 0x52, 0x04, 0x62, 0x6c, + 0x6f, 0x62, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x46, 0x0a, 0x09, 0x4c, - 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x39, 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, - 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x1a, 0x8b, 0x01, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x09, 0x0a, 0x07, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x78, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x06, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, - 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x48, 0x00, - 0x52, 0x06, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x48, 0x00, 0x52, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x22, 0x45, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x1a, 0x3a, 0x0a, 0x12, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x07, 0xba, 0x48, 0x04, 0x2a, 0x02, 0x28, 0x00, 0x52, 0x08, - 0x70, 0x6f, 0x6f, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x66, 0x0a, 0x0a, 0x44, 0x69, 0x73, 0x63, - 0x6f, 0x76, 0x65, 0x72, 0x65, 0x72, 0x1a, 0x58, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, - 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, - 0x22, 0x8c, 0x0d, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0xca, 0x01, 0x0a, 0x05, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x1a, 0x75, 0x0a, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, 0x74, - 0x6f, 0x72, 0x65, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x75, 0x6e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x75, 0x6e, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x69, - 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x69, - 0x6e, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x61, 0x76, 0x69, 0x6e, 0x67, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x06, 0x73, 0x61, 0x76, 0x69, 0x6e, 0x67, 0x1a, 0x4a, 0x0a, 0x04, 0x55, 0x55, - 0x49, 0x44, 0x1a, 0x1f, 0x0a, 0x09, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x12, - 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, - 0x75, 0x69, 0x64, 0x1a, 0x21, 0x0a, 0x0b, 0x55, 0x6e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, - 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x1a, 0xef, 0x01, 0x0a, 0x03, 0x50, 0x6f, 0x64, 0x12, 0x19, - 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, - 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x17, 0x0a, 0x02, 0x69, - 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x78, 0x01, - 0x52, 0x02, 0x69, 0x70, 0x12, 0x26, 0x0a, 0x03, 0x63, 0x70, 0x75, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, - 0x6e, 0x66, 0x6f, 0x2e, 0x43, 0x50, 0x55, 0x52, 0x03, 0x63, 0x70, 0x75, 0x12, 0x2f, 0x0a, 0x06, - 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4d, - 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x29, 0x0a, - 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4e, 0x6f, - 0x64, 0x65, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x1a, 0xe8, 0x01, 0x0a, 0x04, 0x4e, 0x6f, 0x64, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x41, 0x64, 0x64, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x78, - 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x41, 0x64, 0x64, 0x72, 0x12, - 0x26, 0x0a, 0x03, 0x63, 0x70, 0x75, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x43, - 0x50, 0x55, 0x52, 0x03, 0x63, 0x70, 0x75, 0x12, 0x2f, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, - 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, - 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x29, 0x0a, 0x04, 0x50, 0x6f, 0x64, 0x73, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x50, 0x6f, 0x64, 0x73, 0x52, 0x04, 0x50, - 0x6f, 0x64, 0x73, 0x1a, 0x82, 0x02, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, - 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x49, 0x70, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x70, - 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x49, 0x70, 0x73, 0x12, 0x32, 0x0a, 0x05, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x6f, 0x72, 0x74, - 0x52, 0x05, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x12, 0x2f, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, - 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, - 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x3e, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, - 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, - 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0b, 0x61, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x35, 0x0a, 0x0b, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, - 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x1a, - 0x80, 0x01, 0x0a, 0x06, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x3b, 0x0a, 0x06, 0x6c, 0x61, - 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x70, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4c, 0x61, 0x62, - 0x65, 0x6c, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x44, 0x0a, 0x08, 0x4c, + 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x75, + 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, + 0x10, 0x0a, 0x03, 0x69, 0x70, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x69, 0x70, + 0x73, 0x1a, 0x84, 0x01, 0x0a, 0x0e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4c, 0x6f, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x2c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x12, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x09, 0x0a, + 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x46, 0x0a, 0x09, 0x4c, 0x6f, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x39, 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4c, 0x6f, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x1a, 0x8b, 0x01, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x78, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x33, 0x0a, 0x06, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x06, 0x76, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, + 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x45, + 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x1a, 0x3a, 0x0a, 0x12, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x24, 0x0a, 0x09, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0d, 0x42, 0x07, 0xba, 0x48, 0x04, 0x2a, 0x02, 0x28, 0x00, 0x52, 0x08, 0x70, 0x6f, 0x6f, + 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x66, 0x0a, 0x0a, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, + 0x72, 0x65, 0x72, 0x1a, 0x58, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, + 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x6f, 0x64, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x22, 0xee, 0x0e, + 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0xac, 0x03, 0x0a, 0x05, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x1a, 0x75, 0x0a, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x75, 0x6e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x75, 0x6e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x74, 0x65, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x69, 0x6e, 0x67, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x69, 0x6e, 0x67, 0x12, + 0x16, 0x0a, 0x06, 0x73, 0x61, 0x76, 0x69, 0x6e, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x06, 0x73, 0x61, 0x76, 0x69, 0x6e, 0x67, 0x1a, 0xdf, 0x01, 0x0a, 0x06, 0x44, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x12, 0x41, 0x0a, 0x06, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x44, 0x65, 0x74, 0x61, 0x69, + 0x6c, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x12, + 0x1f, 0x0a, 0x0b, 0x6c, 0x69, 0x76, 0x65, 0x5f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6c, 0x69, 0x76, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, + 0x1a, 0x57, 0x0a, 0x0b, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, + 0x66, 0x6f, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x4a, 0x0a, 0x04, 0x55, 0x55, 0x49, + 0x44, 0x1a, 0x1f, 0x0a, 0x09, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, + 0x69, 0x64, 0x1a, 0x21, 0x0a, 0x0b, 0x55, 0x6e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x75, 0x75, 0x69, 0x64, 0x1a, 0xef, 0x01, 0x0a, 0x03, 0x50, 0x6f, 0x64, 0x12, 0x19, 0x0a, + 0x08, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x70, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x78, 0x01, 0x52, + 0x02, 0x69, 0x70, 0x12, 0x26, 0x0a, 0x03, 0x63, 0x70, 0x75, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x14, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, + 0x66, 0x6f, 0x2e, 0x43, 0x50, 0x55, 0x52, 0x03, 0x63, 0x70, 0x75, 0x12, 0x2f, 0x0a, 0x06, 0x6d, + 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4d, 0x65, + 0x6d, 0x6f, 0x72, 0x79, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x29, 0x0a, 0x04, + 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4e, 0x6f, 0x64, + 0x65, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x1a, 0xe8, 0x01, 0x0a, 0x04, 0x4e, 0x6f, 0x64, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x41, 0x64, 0x64, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x78, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x41, 0x64, 0x64, 0x72, 0x12, 0x26, + 0x0a, 0x03, 0x63, 0x70, 0x75, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x43, 0x50, + 0x55, 0x52, 0x03, 0x63, 0x70, 0x75, 0x12, 0x2f, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x52, + 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x29, 0x0a, 0x04, 0x50, 0x6f, 0x64, 0x73, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x50, 0x6f, 0x64, 0x73, 0x52, 0x04, 0x50, 0x6f, + 0x64, 0x73, 0x1a, 0x82, 0x02, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x70, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, + 0x70, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x70, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, + 0x70, 0x73, 0x12, 0x32, 0x0a, 0x05, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, + 0x6e, 0x66, 0x6f, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x52, + 0x05, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x12, 0x2f, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, + 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x3e, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x41, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x35, 0x0a, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, + 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0x80, + 0x01, 0x0a, 0x06, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x3b, 0x0a, 0x06, 0x6c, 0x61, 0x62, + 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x70, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4c, 0x61, 0x62, 0x65, + 0x6c, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, + 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x1a, 0x9e, 0x01, 0x0a, 0x0b, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x4f, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, - 0x38, 0x01, 0x1a, 0x9e, 0x01, 0x0a, 0x0b, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x4f, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x1a, 0x4b, 0x0a, 0x03, 0x43, 0x50, 0x55, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, - 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, - 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x01, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x73, - 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, - 0x1a, 0x4e, 0x0a, 0x06, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, - 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, - 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x01, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x73, - 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, - 0x1a, 0x3a, 0x0a, 0x04, 0x50, 0x6f, 0x64, 0x73, 0x12, 0x32, 0x0a, 0x04, 0x70, 0x6f, 0x64, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x50, 0x6f, 0x64, 0x42, 0x08, 0xba, 0x48, - 0x05, 0x92, 0x01, 0x02, 0x08, 0x01, 0x52, 0x04, 0x70, 0x6f, 0x64, 0x73, 0x1a, 0x3e, 0x0a, 0x05, - 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x35, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, - 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x42, 0x08, 0xba, 0x48, 0x05, - 0x92, 0x01, 0x02, 0x08, 0x01, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x1a, 0x4a, 0x0a, 0x08, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x3e, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x42, 0x08, 0xba, 0x48, 0x05, 0x92, 0x01, 0x02, 0x08, 0x01, 0x52, 0x08, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x1a, 0x15, 0x0a, 0x03, 0x49, 0x50, 0x73, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x22, - 0x7a, 0x0a, 0x06, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x1a, 0x30, 0x0a, 0x06, 0x54, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0x3e, 0x0a, 0x07, 0x54, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x22, 0x07, 0x0a, 0x05, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x42, 0x64, 0x0a, 0x1d, 0x6f, 0x72, 0x67, 0x2e, 0x76, 0x64, 0x61, 0x61, - 0x73, 0x2e, 0x76, 0x61, 0x6c, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x70, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x0b, 0x56, 0x61, 0x6c, 0x64, 0x50, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x76, 0x64, 0x61, 0x61, 0x73, 0x2f, 0x76, 0x61, 0x6c, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x73, - 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0xa2, 0x02, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x38, 0x01, 0x1a, 0x4b, 0x0a, 0x03, 0x43, 0x50, 0x55, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, + 0x18, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, + 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x73, 0x61, + 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x1a, + 0x4e, 0x0a, 0x06, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, + 0x18, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, + 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x73, 0x61, + 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x1a, + 0x3a, 0x0a, 0x04, 0x50, 0x6f, 0x64, 0x73, 0x12, 0x32, 0x0a, 0x04, 0x70, 0x6f, 0x64, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x50, 0x6f, 0x64, 0x42, 0x08, 0xba, 0x48, 0x05, + 0x92, 0x01, 0x02, 0x08, 0x01, 0x52, 0x04, 0x70, 0x6f, 0x64, 0x73, 0x1a, 0x3e, 0x0a, 0x05, 0x4e, + 0x6f, 0x64, 0x65, 0x73, 0x12, 0x35, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x42, 0x08, 0xba, 0x48, 0x05, 0x92, + 0x01, 0x02, 0x08, 0x01, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x1a, 0x4a, 0x0a, 0x08, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x3e, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x42, 0x08, 0xba, 0x48, 0x05, 0x92, 0x01, 0x02, 0x08, 0x01, 0x52, 0x08, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x1a, 0x15, 0x0a, 0x03, 0x49, 0x50, 0x73, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x70, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x22, 0x7a, + 0x0a, 0x06, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x1a, 0x30, 0x0a, 0x06, 0x54, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0x3e, 0x0a, 0x07, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x42, 0x64, 0x0a, 0x1d, 0x6f, 0x72, 0x67, 0x2e, 0x76, 0x64, 0x61, 0x61, 0x73, + 0x2e, 0x76, 0x61, 0x6c, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x70, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x0b, 0x56, 0x61, 0x6c, 0x64, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x76, 0x64, 0x61, 0x61, 0x73, 0x2f, 0x76, 0x61, 0x6c, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, + 0x67, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0xa2, + 0x02, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -5538,8 +5619,8 @@ func file_v1_payload_payload_proto_rawDescGZIP() []byte { } var file_v1_payload_payload_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_v1_payload_payload_proto_msgTypes = make([]protoimpl.MessageInfo, 88) -var file_v1_payload_payload_proto_goTypes = []interface{}{ +var file_v1_payload_payload_proto_msgTypes = make([]protoimpl.MessageInfo, 90) +var file_v1_payload_payload_proto_goTypes = []any{ (Search_AggregationAlgorithm)(0), // 0: payload.v1.Search.AggregationAlgorithm (Remove_Timestamp_Operator)(0), // 1: payload.v1.Remove.Timestamp.Operator (*Search)(nil), // 2: payload.v1.Search @@ -5594,7 +5675,7 @@ var file_v1_payload_payload_proto_goTypes = []interface{}{ (*Object_ID)(nil), // 51: payload.v1.Object.ID (*Object_IDs)(nil), // 52: payload.v1.Object.IDs (*Object_Vector)(nil), // 53: payload.v1.Object.Vector - (*Object_GetTimestampRequest)(nil), // 54: payload.v1.Object.GetTimestampRequest + (*Object_TimestampRequest)(nil), // 54: payload.v1.Object.TimestampRequest (*Object_Timestamp)(nil), // 55: payload.v1.Object.Timestamp (*Object_Vectors)(nil), // 56: payload.v1.Object.Vectors (*Object_StreamVector)(nil), // 57: payload.v1.Object.StreamVector @@ -5623,15 +5704,17 @@ var file_v1_payload_payload_proto_goTypes = []interface{}{ (*Info_Services)(nil), // 80: payload.v1.Info.Services (*Info_IPs)(nil), // 81: payload.v1.Info.IPs (*Info_Index_Count)(nil), // 82: payload.v1.Info.Index.Count - (*Info_Index_UUID)(nil), // 83: payload.v1.Info.Index.UUID - (*Info_Index_UUID_Committed)(nil), // 84: payload.v1.Info.Index.UUID.Committed - (*Info_Index_UUID_Uncommitted)(nil), // 85: payload.v1.Info.Index.UUID.Uncommitted - nil, // 86: payload.v1.Info.Labels.LabelsEntry - nil, // 87: payload.v1.Info.Annotations.AnnotationsEntry - (*Mirror_Target)(nil), // 88: payload.v1.Mirror.Target - (*Mirror_Targets)(nil), // 89: payload.v1.Mirror.Targets - (*wrapperspb.FloatValue)(nil), // 90: google.protobuf.FloatValue - (*status.Status)(nil), // 91: google.rpc.Status + (*Info_Index_Detail)(nil), // 83: payload.v1.Info.Index.Detail + (*Info_Index_UUID)(nil), // 84: payload.v1.Info.Index.UUID + nil, // 85: payload.v1.Info.Index.Detail.CountsEntry + (*Info_Index_UUID_Committed)(nil), // 86: payload.v1.Info.Index.UUID.Committed + (*Info_Index_UUID_Uncommitted)(nil), // 87: payload.v1.Info.Index.UUID.Uncommitted + nil, // 88: payload.v1.Info.Labels.LabelsEntry + nil, // 89: payload.v1.Info.Annotations.AnnotationsEntry + (*Mirror_Target)(nil), // 90: payload.v1.Mirror.Target + (*Mirror_Targets)(nil), // 91: payload.v1.Mirror.Targets + (*wrapperspb.FloatValue)(nil), // 92: google.protobuf.FloatValue + (*status.Status)(nil), // 93: google.rpc.Status } var file_v1_payload_payload_proto_depIdxs = []int32{ 21, // 0: payload.v1.Search.Request.config:type_name -> payload.v1.Search.Config @@ -5644,11 +5727,11 @@ var file_v1_payload_payload_proto_depIdxs = []int32{ 26, // 7: payload.v1.Search.Config.ingress_filters:type_name -> payload.v1.Filter.Config 26, // 8: payload.v1.Search.Config.egress_filters:type_name -> payload.v1.Filter.Config 0, // 9: payload.v1.Search.Config.aggregation_algorithm:type_name -> payload.v1.Search.AggregationAlgorithm - 90, // 10: payload.v1.Search.Config.ratio:type_name -> google.protobuf.FloatValue + 92, // 10: payload.v1.Search.Config.ratio:type_name -> google.protobuf.FloatValue 49, // 11: payload.v1.Search.Response.results:type_name -> payload.v1.Object.Distance 22, // 12: payload.v1.Search.Responses.responses:type_name -> payload.v1.Search.Response 22, // 13: payload.v1.Search.StreamResponse.response:type_name -> payload.v1.Search.Response - 91, // 14: payload.v1.Search.StreamResponse.status:type_name -> google.rpc.Status + 93, // 14: payload.v1.Search.StreamResponse.status:type_name -> google.rpc.Status 25, // 15: payload.v1.Filter.Config.targets:type_name -> payload.v1.Filter.Target 53, // 16: payload.v1.Insert.Request.vector:type_name -> payload.v1.Object.Vector 31, // 17: payload.v1.Insert.Request.config:type_name -> payload.v1.Insert.Config @@ -5682,18 +5765,18 @@ var file_v1_payload_payload_proto_depIdxs = []int32{ 51, // 45: payload.v1.Object.VectorRequest.id:type_name -> payload.v1.Object.ID 26, // 46: payload.v1.Object.VectorRequest.filters:type_name -> payload.v1.Filter.Config 49, // 47: payload.v1.Object.StreamDistance.distance:type_name -> payload.v1.Object.Distance - 91, // 48: payload.v1.Object.StreamDistance.status:type_name -> google.rpc.Status - 51, // 49: payload.v1.Object.GetTimestampRequest.id:type_name -> payload.v1.Object.ID + 93, // 48: payload.v1.Object.StreamDistance.status:type_name -> google.rpc.Status + 51, // 49: payload.v1.Object.TimestampRequest.id:type_name -> payload.v1.Object.ID 53, // 50: payload.v1.Object.Vectors.vectors:type_name -> payload.v1.Object.Vector 53, // 51: payload.v1.Object.StreamVector.vector:type_name -> payload.v1.Object.Vector - 91, // 52: payload.v1.Object.StreamVector.status:type_name -> google.rpc.Status + 93, // 52: payload.v1.Object.StreamVector.status:type_name -> google.rpc.Status 59, // 53: payload.v1.Object.StreamBlob.blob:type_name -> payload.v1.Object.Blob - 91, // 54: payload.v1.Object.StreamBlob.status:type_name -> google.rpc.Status + 93, // 54: payload.v1.Object.StreamBlob.status:type_name -> google.rpc.Status 61, // 55: payload.v1.Object.StreamLocation.location:type_name -> payload.v1.Object.Location - 91, // 56: payload.v1.Object.StreamLocation.status:type_name -> google.rpc.Status + 93, // 56: payload.v1.Object.StreamLocation.status:type_name -> google.rpc.Status 61, // 57: payload.v1.Object.Locations.locations:type_name -> payload.v1.Object.Location 53, // 58: payload.v1.Object.List.Response.vector:type_name -> payload.v1.Object.Vector - 91, // 59: payload.v1.Object.List.Response.status:type_name -> google.rpc.Status + 93, // 59: payload.v1.Object.List.Response.status:type_name -> google.rpc.Status 76, // 60: payload.v1.Info.Pod.cpu:type_name -> payload.v1.Info.CPU 77, // 61: payload.v1.Info.Pod.memory:type_name -> payload.v1.Info.Memory 71, // 62: payload.v1.Info.Pod.node:type_name -> payload.v1.Info.Node @@ -5703,17 +5786,19 @@ var file_v1_payload_payload_proto_depIdxs = []int32{ 73, // 66: payload.v1.Info.Service.ports:type_name -> payload.v1.Info.ServicePort 74, // 67: payload.v1.Info.Service.labels:type_name -> payload.v1.Info.Labels 75, // 68: payload.v1.Info.Service.annotations:type_name -> payload.v1.Info.Annotations - 86, // 69: payload.v1.Info.Labels.labels:type_name -> payload.v1.Info.Labels.LabelsEntry - 87, // 70: payload.v1.Info.Annotations.annotations:type_name -> payload.v1.Info.Annotations.AnnotationsEntry + 88, // 69: payload.v1.Info.Labels.labels:type_name -> payload.v1.Info.Labels.LabelsEntry + 89, // 70: payload.v1.Info.Annotations.annotations:type_name -> payload.v1.Info.Annotations.AnnotationsEntry 70, // 71: payload.v1.Info.Pods.pods:type_name -> payload.v1.Info.Pod 71, // 72: payload.v1.Info.Nodes.nodes:type_name -> payload.v1.Info.Node 72, // 73: payload.v1.Info.Services.services:type_name -> payload.v1.Info.Service - 88, // 74: payload.v1.Mirror.Targets.targets:type_name -> payload.v1.Mirror.Target - 75, // [75:75] is the sub-list for method output_type - 75, // [75:75] is the sub-list for method input_type - 75, // [75:75] is the sub-list for extension type_name - 75, // [75:75] is the sub-list for extension extendee - 0, // [0:75] is the sub-list for field type_name + 85, // 74: payload.v1.Info.Index.Detail.counts:type_name -> payload.v1.Info.Index.Detail.CountsEntry + 82, // 75: payload.v1.Info.Index.Detail.CountsEntry.value:type_name -> payload.v1.Info.Index.Count + 90, // 76: payload.v1.Mirror.Targets.targets:type_name -> payload.v1.Mirror.Target + 77, // [77:77] is the sub-list for method output_type + 77, // [77:77] is the sub-list for method input_type + 77, // [77:77] is the sub-list for extension type_name + 77, // [77:77] is the sub-list for extension extendee + 0, // [0:77] is the sub-list for field type_name } func init() { file_v1_payload_payload_proto_init() } @@ -5722,7 +5807,7 @@ func file_v1_payload_payload_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_v1_payload_payload_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*Search); i { case 0: return &v.state @@ -5734,7 +5819,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*Filter); i { case 0: return &v.state @@ -5746,7 +5831,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*Insert); i { case 0: return &v.state @@ -5758,7 +5843,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*Update); i { case 0: return &v.state @@ -5770,7 +5855,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*Upsert); i { case 0: return &v.state @@ -5782,7 +5867,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[5].Exporter = func(v any, i int) any { switch v := v.(*Remove); i { case 0: return &v.state @@ -5794,7 +5879,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[6].Exporter = func(v any, i int) any { switch v := v.(*Flush); i { case 0: return &v.state @@ -5806,7 +5891,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[7].Exporter = func(v any, i int) any { switch v := v.(*Object); i { case 0: return &v.state @@ -5818,7 +5903,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[8].Exporter = func(v any, i int) any { switch v := v.(*Control); i { case 0: return &v.state @@ -5830,7 +5915,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[9].Exporter = func(v any, i int) any { switch v := v.(*Discoverer); i { case 0: return &v.state @@ -5842,7 +5927,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[10].Exporter = func(v any, i int) any { switch v := v.(*Info); i { case 0: return &v.state @@ -5854,7 +5939,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[11].Exporter = func(v any, i int) any { switch v := v.(*Mirror); i { case 0: return &v.state @@ -5866,7 +5951,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[12].Exporter = func(v any, i int) any { switch v := v.(*Empty); i { case 0: return &v.state @@ -5878,7 +5963,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[13].Exporter = func(v any, i int) any { switch v := v.(*Search_Request); i { case 0: return &v.state @@ -5890,7 +5975,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[14].Exporter = func(v any, i int) any { switch v := v.(*Search_MultiRequest); i { case 0: return &v.state @@ -5902,7 +5987,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[15].Exporter = func(v any, i int) any { switch v := v.(*Search_IDRequest); i { case 0: return &v.state @@ -5914,7 +5999,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[16].Exporter = func(v any, i int) any { switch v := v.(*Search_MultiIDRequest); i { case 0: return &v.state @@ -5926,7 +6011,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[17].Exporter = func(v any, i int) any { switch v := v.(*Search_ObjectRequest); i { case 0: return &v.state @@ -5938,7 +6023,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[18].Exporter = func(v any, i int) any { switch v := v.(*Search_MultiObjectRequest); i { case 0: return &v.state @@ -5950,7 +6035,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[19].Exporter = func(v any, i int) any { switch v := v.(*Search_Config); i { case 0: return &v.state @@ -5962,7 +6047,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[20].Exporter = func(v any, i int) any { switch v := v.(*Search_Response); i { case 0: return &v.state @@ -5974,7 +6059,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[21].Exporter = func(v any, i int) any { switch v := v.(*Search_Responses); i { case 0: return &v.state @@ -5986,7 +6071,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[22].Exporter = func(v any, i int) any { switch v := v.(*Search_StreamResponse); i { case 0: return &v.state @@ -5998,7 +6083,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[23].Exporter = func(v any, i int) any { switch v := v.(*Filter_Target); i { case 0: return &v.state @@ -6010,7 +6095,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[24].Exporter = func(v any, i int) any { switch v := v.(*Filter_Config); i { case 0: return &v.state @@ -6022,7 +6107,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[25].Exporter = func(v any, i int) any { switch v := v.(*Insert_Request); i { case 0: return &v.state @@ -6034,7 +6119,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[26].Exporter = func(v any, i int) any { switch v := v.(*Insert_MultiRequest); i { case 0: return &v.state @@ -6046,7 +6131,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[27].Exporter = func(v any, i int) any { switch v := v.(*Insert_ObjectRequest); i { case 0: return &v.state @@ -6058,7 +6143,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[28].Exporter = func(v any, i int) any { switch v := v.(*Insert_MultiObjectRequest); i { case 0: return &v.state @@ -6070,7 +6155,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[29].Exporter = func(v any, i int) any { switch v := v.(*Insert_Config); i { case 0: return &v.state @@ -6082,7 +6167,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[30].Exporter = func(v any, i int) any { switch v := v.(*Update_Request); i { case 0: return &v.state @@ -6094,7 +6179,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[31].Exporter = func(v any, i int) any { switch v := v.(*Update_MultiRequest); i { case 0: return &v.state @@ -6106,7 +6191,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[32].Exporter = func(v any, i int) any { switch v := v.(*Update_ObjectRequest); i { case 0: return &v.state @@ -6118,7 +6203,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[33].Exporter = func(v any, i int) any { switch v := v.(*Update_MultiObjectRequest); i { case 0: return &v.state @@ -6130,7 +6215,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[34].Exporter = func(v any, i int) any { switch v := v.(*Update_Config); i { case 0: return &v.state @@ -6142,7 +6227,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[35].Exporter = func(v any, i int) any { switch v := v.(*Upsert_Request); i { case 0: return &v.state @@ -6154,7 +6239,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[36].Exporter = func(v any, i int) any { switch v := v.(*Upsert_MultiRequest); i { case 0: return &v.state @@ -6166,7 +6251,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[37].Exporter = func(v any, i int) any { switch v := v.(*Upsert_ObjectRequest); i { case 0: return &v.state @@ -6178,7 +6263,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[38].Exporter = func(v any, i int) any { switch v := v.(*Upsert_MultiObjectRequest); i { case 0: return &v.state @@ -6190,7 +6275,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[39].Exporter = func(v any, i int) any { switch v := v.(*Upsert_Config); i { case 0: return &v.state @@ -6202,7 +6287,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[40].Exporter = func(v any, i int) any { switch v := v.(*Remove_Request); i { case 0: return &v.state @@ -6214,7 +6299,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[41].Exporter = func(v any, i int) any { switch v := v.(*Remove_MultiRequest); i { case 0: return &v.state @@ -6226,7 +6311,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[42].Exporter = func(v any, i int) any { switch v := v.(*Remove_TimestampRequest); i { case 0: return &v.state @@ -6238,7 +6323,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[43].Exporter = func(v any, i int) any { switch v := v.(*Remove_Timestamp); i { case 0: return &v.state @@ -6250,7 +6335,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[44].Exporter = func(v any, i int) any { switch v := v.(*Remove_Config); i { case 0: return &v.state @@ -6262,7 +6347,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[45].Exporter = func(v any, i int) any { switch v := v.(*Flush_Request); i { case 0: return &v.state @@ -6274,7 +6359,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[46].Exporter = func(v any, i int) any { switch v := v.(*Object_VectorRequest); i { case 0: return &v.state @@ -6286,7 +6371,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[47].Exporter = func(v any, i int) any { switch v := v.(*Object_Distance); i { case 0: return &v.state @@ -6298,7 +6383,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[48].Exporter = func(v any, i int) any { switch v := v.(*Object_StreamDistance); i { case 0: return &v.state @@ -6310,7 +6395,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[49].Exporter = func(v any, i int) any { switch v := v.(*Object_ID); i { case 0: return &v.state @@ -6322,7 +6407,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[50].Exporter = func(v any, i int) any { switch v := v.(*Object_IDs); i { case 0: return &v.state @@ -6334,7 +6419,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[51].Exporter = func(v any, i int) any { switch v := v.(*Object_Vector); i { case 0: return &v.state @@ -6346,8 +6431,8 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_GetTimestampRequest); i { + file_v1_payload_payload_proto_msgTypes[52].Exporter = func(v any, i int) any { + switch v := v.(*Object_TimestampRequest); i { case 0: return &v.state case 1: @@ -6358,7 +6443,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[53].Exporter = func(v any, i int) any { switch v := v.(*Object_Timestamp); i { case 0: return &v.state @@ -6370,7 +6455,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[54].Exporter = func(v any, i int) any { switch v := v.(*Object_Vectors); i { case 0: return &v.state @@ -6382,7 +6467,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[55].Exporter = func(v any, i int) any { switch v := v.(*Object_StreamVector); i { case 0: return &v.state @@ -6394,7 +6479,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[56].Exporter = func(v any, i int) any { switch v := v.(*Object_ReshapeVector); i { case 0: return &v.state @@ -6406,7 +6491,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[57].Exporter = func(v any, i int) any { switch v := v.(*Object_Blob); i { case 0: return &v.state @@ -6418,7 +6503,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[58].Exporter = func(v any, i int) any { switch v := v.(*Object_StreamBlob); i { case 0: return &v.state @@ -6430,7 +6515,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[59].Exporter = func(v any, i int) any { switch v := v.(*Object_Location); i { case 0: return &v.state @@ -6442,7 +6527,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[60].Exporter = func(v any, i int) any { switch v := v.(*Object_StreamLocation); i { case 0: return &v.state @@ -6454,7 +6539,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[61].Exporter = func(v any, i int) any { switch v := v.(*Object_Locations); i { case 0: return &v.state @@ -6466,7 +6551,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[62].Exporter = func(v any, i int) any { switch v := v.(*Object_List); i { case 0: return &v.state @@ -6478,7 +6563,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[63].Exporter = func(v any, i int) any { switch v := v.(*Object_List_Request); i { case 0: return &v.state @@ -6490,7 +6575,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[64].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[64].Exporter = func(v any, i int) any { switch v := v.(*Object_List_Response); i { case 0: return &v.state @@ -6502,7 +6587,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[65].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[65].Exporter = func(v any, i int) any { switch v := v.(*Control_CreateIndexRequest); i { case 0: return &v.state @@ -6514,7 +6599,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[66].Exporter = func(v any, i int) any { switch v := v.(*Discoverer_Request); i { case 0: return &v.state @@ -6526,7 +6611,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[67].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[67].Exporter = func(v any, i int) any { switch v := v.(*Info_Index); i { case 0: return &v.state @@ -6538,7 +6623,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[68].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[68].Exporter = func(v any, i int) any { switch v := v.(*Info_Pod); i { case 0: return &v.state @@ -6550,7 +6635,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[69].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[69].Exporter = func(v any, i int) any { switch v := v.(*Info_Node); i { case 0: return &v.state @@ -6562,7 +6647,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[70].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[70].Exporter = func(v any, i int) any { switch v := v.(*Info_Service); i { case 0: return &v.state @@ -6574,7 +6659,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[71].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[71].Exporter = func(v any, i int) any { switch v := v.(*Info_ServicePort); i { case 0: return &v.state @@ -6586,7 +6671,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[72].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[72].Exporter = func(v any, i int) any { switch v := v.(*Info_Labels); i { case 0: return &v.state @@ -6598,7 +6683,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[73].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[73].Exporter = func(v any, i int) any { switch v := v.(*Info_Annotations); i { case 0: return &v.state @@ -6610,7 +6695,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[74].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[74].Exporter = func(v any, i int) any { switch v := v.(*Info_CPU); i { case 0: return &v.state @@ -6622,7 +6707,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[75].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[75].Exporter = func(v any, i int) any { switch v := v.(*Info_Memory); i { case 0: return &v.state @@ -6634,7 +6719,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[76].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[76].Exporter = func(v any, i int) any { switch v := v.(*Info_Pods); i { case 0: return &v.state @@ -6646,7 +6731,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[77].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[77].Exporter = func(v any, i int) any { switch v := v.(*Info_Nodes); i { case 0: return &v.state @@ -6658,7 +6743,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[78].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[78].Exporter = func(v any, i int) any { switch v := v.(*Info_Services); i { case 0: return &v.state @@ -6670,7 +6755,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[79].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[79].Exporter = func(v any, i int) any { switch v := v.(*Info_IPs); i { case 0: return &v.state @@ -6682,7 +6767,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[80].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[80].Exporter = func(v any, i int) any { switch v := v.(*Info_Index_Count); i { case 0: return &v.state @@ -6694,7 +6779,19 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[81].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[81].Exporter = func(v any, i int) any { + switch v := v.(*Info_Index_Detail); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_payload_payload_proto_msgTypes[82].Exporter = func(v any, i int) any { switch v := v.(*Info_Index_UUID); i { case 0: return &v.state @@ -6706,7 +6803,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[82].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[84].Exporter = func(v any, i int) any { switch v := v.(*Info_Index_UUID_Committed); i { case 0: return &v.state @@ -6718,7 +6815,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[83].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[85].Exporter = func(v any, i int) any { switch v := v.(*Info_Index_UUID_Uncommitted); i { case 0: return &v.state @@ -6730,7 +6827,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[86].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[88].Exporter = func(v any, i int) any { switch v := v.(*Mirror_Target); i { case 0: return &v.state @@ -6742,7 +6839,7 @@ func file_v1_payload_payload_proto_init() { return nil } } - file_v1_payload_payload_proto_msgTypes[87].Exporter = func(v interface{}, i int) interface{} { + file_v1_payload_payload_proto_msgTypes[89].Exporter = func(v any, i int) any { switch v := v.(*Mirror_Targets); i { case 0: return &v.state @@ -6755,27 +6852,27 @@ func file_v1_payload_payload_proto_init() { } } } - file_v1_payload_payload_proto_msgTypes[22].OneofWrappers = []interface{}{ + file_v1_payload_payload_proto_msgTypes[22].OneofWrappers = []any{ (*Search_StreamResponse_Response)(nil), (*Search_StreamResponse_Status)(nil), } - file_v1_payload_payload_proto_msgTypes[48].OneofWrappers = []interface{}{ + file_v1_payload_payload_proto_msgTypes[48].OneofWrappers = []any{ (*Object_StreamDistance_Distance)(nil), (*Object_StreamDistance_Status)(nil), } - file_v1_payload_payload_proto_msgTypes[55].OneofWrappers = []interface{}{ + file_v1_payload_payload_proto_msgTypes[55].OneofWrappers = []any{ (*Object_StreamVector_Vector)(nil), (*Object_StreamVector_Status)(nil), } - file_v1_payload_payload_proto_msgTypes[58].OneofWrappers = []interface{}{ + file_v1_payload_payload_proto_msgTypes[58].OneofWrappers = []any{ (*Object_StreamBlob_Blob)(nil), (*Object_StreamBlob_Status)(nil), } - file_v1_payload_payload_proto_msgTypes[60].OneofWrappers = []interface{}{ + file_v1_payload_payload_proto_msgTypes[60].OneofWrappers = []any{ (*Object_StreamLocation_Location)(nil), (*Object_StreamLocation_Status)(nil), } - file_v1_payload_payload_proto_msgTypes[64].OneofWrappers = []interface{}{ + file_v1_payload_payload_proto_msgTypes[64].OneofWrappers = []any{ (*Object_List_Response_Vector)(nil), (*Object_List_Response_Status)(nil), } @@ -6785,7 +6882,7 @@ func file_v1_payload_payload_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_v1_payload_payload_proto_rawDesc, NumEnums: 2, - NumMessages: 88, + NumMessages: 90, NumExtensions: 0, NumServices: 0, }, diff --git a/apis/grpc/v1/payload/payload.pb.json.go b/apis/grpc/v1/payload/payload.pb.json.go index cf5d15d4d59..96c5c744954 100644 --- a/apis/grpc/v1/payload/payload.pb.json.go +++ b/apis/grpc/v1/payload/payload.pb.json.go @@ -19,9 +19,7 @@ package payload -import ( - "google.golang.org/protobuf/encoding/protojson" -) +import "google.golang.org/protobuf/encoding/protojson" // MarshalJSON implements json.Marshaler func (msg *Search) MarshalJSON() ([]byte, error) { @@ -494,12 +492,12 @@ func (msg *Object_Vector) UnmarshalJSON(b []byte) error { } // MarshalJSON implements json.Marshaler -func (msg *Object_GetTimestampRequest) MarshalJSON() ([]byte, error) { +func (msg *Object_TimestampRequest) MarshalJSON() ([]byte, error) { return protojson.MarshalOptions{}.Marshal(msg) } // UnmarshalJSON implements json.Unmarshaler -func (msg *Object_GetTimestampRequest) UnmarshalJSON(b []byte) error { +func (msg *Object_TimestampRequest) UnmarshalJSON(b []byte) error { return protojson.UnmarshalOptions{}.Unmarshal(b, msg) } @@ -693,6 +691,16 @@ func (msg *Info_Index_Count) UnmarshalJSON(b []byte) error { return protojson.UnmarshalOptions{}.Unmarshal(b, msg) } +// MarshalJSON implements json.Marshaler +func (msg *Info_Index_Detail) MarshalJSON() ([]byte, error) { + return protojson.MarshalOptions{}.Marshal(msg) +} + +// UnmarshalJSON implements json.Unmarshaler +func (msg *Info_Index_Detail) UnmarshalJSON(b []byte) error { + return protojson.UnmarshalOptions{}.Unmarshal(b, msg) +} + // MarshalJSON implements json.Marshaler func (msg *Info_Index_UUID) MarshalJSON() ([]byte, error) { return protojson.MarshalOptions{}.Marshal(msg) diff --git a/apis/grpc/v1/payload/payload_vtproto.pb.go b/apis/grpc/v1/payload/payload_vtproto.pb.go index 53d8e69ecc6..3daa37f0afe 100644 --- a/apis/grpc/v1/payload/payload_vtproto.pb.go +++ b/apis/grpc/v1/payload/payload_vtproto.pb.go @@ -278,7 +278,7 @@ func (m *Search_StreamResponse_Status) CloneVT() isSearch_StreamResponse_Payload } r := new(Search_StreamResponse_Status) if rhs := m.Status; rhs != nil { - if vtpb, ok := interface{}(rhs).(interface{ CloneVT() *status.Status }); ok { + if vtpb, ok := any(rhs).(interface{ CloneVT() *status.Status }); ok { r.Status = vtpb.CloneVT() } else { r.Status = proto.Clone(rhs).(*status.Status) @@ -936,7 +936,7 @@ func (m *Object_StreamDistance_Status) CloneVT() isObject_StreamDistance_Payload } r := new(Object_StreamDistance_Status) if rhs := m.Status; rhs != nil { - if vtpb, ok := interface{}(rhs).(interface{ CloneVT() *status.Status }); ok { + if vtpb, ok := any(rhs).(interface{ CloneVT() *status.Status }); ok { r.Status = vtpb.CloneVT() } else { r.Status = proto.Clone(rhs).(*status.Status) @@ -1006,11 +1006,11 @@ func (m *Object_Vector) CloneMessageVT() proto.Message { return m.CloneVT() } -func (m *Object_GetTimestampRequest) CloneVT() *Object_GetTimestampRequest { +func (m *Object_TimestampRequest) CloneVT() *Object_TimestampRequest { if m == nil { - return (*Object_GetTimestampRequest)(nil) + return (*Object_TimestampRequest)(nil) } - r := new(Object_GetTimestampRequest) + r := new(Object_TimestampRequest) r.Id = m.Id.CloneVT() if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) @@ -1019,7 +1019,7 @@ func (m *Object_GetTimestampRequest) CloneVT() *Object_GetTimestampRequest { return r } -func (m *Object_GetTimestampRequest) CloneMessageVT() proto.Message { +func (m *Object_TimestampRequest) CloneMessageVT() proto.Message { return m.CloneVT() } @@ -1100,7 +1100,7 @@ func (m *Object_StreamVector_Status) CloneVT() isObject_StreamVector_Payload { } r := new(Object_StreamVector_Status) if rhs := m.Status; rhs != nil { - if vtpb, ok := interface{}(rhs).(interface{ CloneVT() *status.Status }); ok { + if vtpb, ok := any(rhs).(interface{ CloneVT() *status.Status }); ok { r.Status = vtpb.CloneVT() } else { r.Status = proto.Clone(rhs).(*status.Status) @@ -1193,7 +1193,7 @@ func (m *Object_StreamBlob_Status) CloneVT() isObject_StreamBlob_Payload { } r := new(Object_StreamBlob_Status) if rhs := m.Status; rhs != nil { - if vtpb, ok := interface{}(rhs).(interface{ CloneVT() *status.Status }); ok { + if vtpb, ok := any(rhs).(interface{ CloneVT() *status.Status }); ok { r.Status = vtpb.CloneVT() } else { r.Status = proto.Clone(rhs).(*status.Status) @@ -1261,7 +1261,7 @@ func (m *Object_StreamLocation_Status) CloneVT() isObject_StreamLocation_Payload } r := new(Object_StreamLocation_Status) if rhs := m.Status; rhs != nil { - if vtpb, ok := interface{}(rhs).(interface{ CloneVT() *status.Status }); ok { + if vtpb, ok := any(rhs).(interface{ CloneVT() *status.Status }); ok { r.Status = vtpb.CloneVT() } else { r.Status = proto.Clone(rhs).(*status.Status) @@ -1345,7 +1345,7 @@ func (m *Object_List_Response_Status) CloneVT() isObject_List_Response_Payload { } r := new(Object_List_Response_Status) if rhs := m.Status; rhs != nil { - if vtpb, ok := interface{}(rhs).(interface{ CloneVT() *status.Status }); ok { + if vtpb, ok := any(rhs).(interface{ CloneVT() *status.Status }); ok { r.Status = vtpb.CloneVT() } else { r.Status = proto.Clone(rhs).(*status.Status) @@ -1474,6 +1474,31 @@ func (m *Info_Index_Count) CloneMessageVT() proto.Message { return m.CloneVT() } +func (m *Info_Index_Detail) CloneVT() *Info_Index_Detail { + if m == nil { + return (*Info_Index_Detail)(nil) + } + r := new(Info_Index_Detail) + r.Replica = m.Replica + r.LiveAgents = m.LiveAgents + if rhs := m.Counts; rhs != nil { + tmpContainer := make(map[string]*Info_Index_Count, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Counts = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Info_Index_Detail) CloneMessageVT() proto.Message { + return m.CloneVT() +} + func (m *Info_Index_UUID_Committed) CloneVT() *Info_Index_UUID_Committed { if m == nil { return (*Info_Index_UUID_Committed)(nil) @@ -2215,7 +2240,9 @@ func (this *Search_StreamResponse) EqualMessageVT(thatMsg proto.Message) bool { } return this.EqualVT(that) } -func (this *Search_StreamResponse_Response) EqualVT(thatIface isSearch_StreamResponse_Payload) bool { +func (this *Search_StreamResponse_Response) EqualVT( + thatIface isSearch_StreamResponse_Payload, +) bool { that, ok := thatIface.(*Search_StreamResponse_Response) if !ok { return false @@ -2258,7 +2285,7 @@ func (this *Search_StreamResponse_Status) EqualVT(thatIface isSearch_StreamRespo if q == nil { q = &status.Status{} } - if equal, ok := interface{}(p).(interface{ EqualVT(*status.Status) bool }); ok { + if equal, ok := any(p).(interface{ EqualVT(*status.Status) bool }); ok { if !equal.EqualVT(q) { return false } @@ -3076,7 +3103,9 @@ func (this *Object_StreamDistance) EqualMessageVT(thatMsg proto.Message) bool { } return this.EqualVT(that) } -func (this *Object_StreamDistance_Distance) EqualVT(thatIface isObject_StreamDistance_Payload) bool { +func (this *Object_StreamDistance_Distance) EqualVT( + thatIface isObject_StreamDistance_Payload, +) bool { that, ok := thatIface.(*Object_StreamDistance_Distance) if !ok { return false @@ -3119,7 +3148,7 @@ func (this *Object_StreamDistance_Status) EqualVT(thatIface isObject_StreamDista if q == nil { q = &status.Status{} } - if equal, ok := interface{}(p).(interface{ EqualVT(*status.Status) bool }); ok { + if equal, ok := any(p).(interface{ EqualVT(*status.Status) bool }); ok { if !equal.EqualVT(q) { return false } @@ -3205,7 +3234,7 @@ func (this *Object_Vector) EqualMessageVT(thatMsg proto.Message) bool { } return this.EqualVT(that) } -func (this *Object_GetTimestampRequest) EqualVT(that *Object_GetTimestampRequest) bool { +func (this *Object_TimestampRequest) EqualVT(that *Object_TimestampRequest) bool { if this == that { return true } else if this == nil || that == nil { @@ -3217,8 +3246,8 @@ func (this *Object_GetTimestampRequest) EqualVT(that *Object_GetTimestampRequest return string(this.unknownFields) == string(that.unknownFields) } -func (this *Object_GetTimestampRequest) EqualMessageVT(thatMsg proto.Message) bool { - that, ok := thatMsg.(*Object_GetTimestampRequest) +func (this *Object_TimestampRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Object_TimestampRequest) if !ok { return false } @@ -3350,7 +3379,7 @@ func (this *Object_StreamVector_Status) EqualVT(thatIface isObject_StreamVector_ if q == nil { q = &status.Status{} } - if equal, ok := interface{}(p).(interface{ EqualVT(*status.Status) bool }); ok { + if equal, ok := any(p).(interface{ EqualVT(*status.Status) bool }); ok { if !equal.EqualVT(q) { return false } @@ -3482,7 +3511,7 @@ func (this *Object_StreamBlob_Status) EqualVT(thatIface isObject_StreamBlob_Payl if q == nil { q = &status.Status{} } - if equal, ok := interface{}(p).(interface{ EqualVT(*status.Status) bool }); ok { + if equal, ok := any(p).(interface{ EqualVT(*status.Status) bool }); ok { if !equal.EqualVT(q) { return false } @@ -3552,7 +3581,9 @@ func (this *Object_StreamLocation) EqualMessageVT(thatMsg proto.Message) bool { } return this.EqualVT(that) } -func (this *Object_StreamLocation_Location) EqualVT(thatIface isObject_StreamLocation_Payload) bool { +func (this *Object_StreamLocation_Location) EqualVT( + thatIface isObject_StreamLocation_Payload, +) bool { that, ok := thatIface.(*Object_StreamLocation_Location) if !ok { return false @@ -3595,7 +3626,7 @@ func (this *Object_StreamLocation_Status) EqualVT(thatIface isObject_StreamLocat if q == nil { q = &status.Status{} } - if equal, ok := interface{}(p).(interface{ EqualVT(*status.Status) bool }); ok { + if equal, ok := any(p).(interface{ EqualVT(*status.Status) bool }); ok { if !equal.EqualVT(q) { return false } @@ -3726,7 +3757,7 @@ func (this *Object_List_Response_Status) EqualVT(thatIface isObject_List_Respons if q == nil { q = &status.Status{} } - if equal, ok := interface{}(p).(interface{ EqualVT(*status.Status) bool }); ok { + if equal, ok := any(p).(interface{ EqualVT(*status.Status) bool }); ok { if !equal.EqualVT(q) { return false } @@ -3873,6 +3904,48 @@ func (this *Info_Index_Count) EqualMessageVT(thatMsg proto.Message) bool { } return this.EqualVT(that) } +func (this *Info_Index_Detail) EqualVT(that *Info_Index_Detail) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Counts) != len(that.Counts) { + return false + } + for i, vx := range this.Counts { + vy, ok := that.Counts[i] + if !ok { + return false + } + if p, q := vx, vy; p != q { + if p == nil { + p = &Info_Index_Count{} + } + if q == nil { + q = &Info_Index_Count{} + } + if !p.EqualVT(q) { + return false + } + } + } + if this.Replica != that.Replica { + return false + } + if this.LiveAgents != that.LiveAgents { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Info_Index_Detail) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Info_Index_Detail) + if !ok { + return false + } + return this.EqualVT(that) +} func (this *Info_Index_UUID_Committed) EqualVT(that *Info_Index_UUID_Committed) bool { if this == that { return true @@ -4989,7 +5062,7 @@ func (m *Search_StreamResponse_Status) MarshalToVT(dAtA []byte) (int, error) { func (m *Search_StreamResponse_Status) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) if m.Status != nil { - if vtmsg, ok := interface{}(m.Status).(interface { + if vtmsg, ok := any(m.Status).(interface { MarshalToSizedBufferVT([]byte) (int, error) }); ok { size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) @@ -6580,7 +6653,7 @@ func (m *Object_StreamDistance_Status) MarshalToVT(dAtA []byte) (int, error) { func (m *Object_StreamDistance_Status) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) if m.Status != nil { - if vtmsg, ok := interface{}(m.Status).(interface { + if vtmsg, ok := any(m.Status).(interface { MarshalToSizedBufferVT([]byte) (int, error) }); ok { size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) @@ -6740,7 +6813,7 @@ func (m *Object_Vector) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *Object_GetTimestampRequest) MarshalVT() (dAtA []byte, err error) { +func (m *Object_TimestampRequest) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -6753,12 +6826,12 @@ func (m *Object_GetTimestampRequest) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Object_GetTimestampRequest) MarshalToVT(dAtA []byte) (int, error) { +func (m *Object_TimestampRequest) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *Object_GetTimestampRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *Object_TimestampRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -6942,7 +7015,7 @@ func (m *Object_StreamVector_Status) MarshalToVT(dAtA []byte) (int, error) { func (m *Object_StreamVector_Status) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) if m.Status != nil { - if vtmsg, ok := interface{}(m.Status).(interface { + if vtmsg, ok := any(m.Status).(interface { MarshalToSizedBufferVT([]byte) (int, error) }); ok { size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) @@ -7142,7 +7215,7 @@ func (m *Object_StreamBlob_Status) MarshalToVT(dAtA []byte) (int, error) { func (m *Object_StreamBlob_Status) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) if m.Status != nil { - if vtmsg, ok := interface{}(m.Status).(interface { + if vtmsg, ok := any(m.Status).(interface { MarshalToSizedBufferVT([]byte) (int, error) }); ok { size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) @@ -7290,7 +7363,7 @@ func (m *Object_StreamLocation_Status) MarshalToVT(dAtA []byte) (int, error) { func (m *Object_StreamLocation_Status) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) if m.Status != nil { - if vtmsg, ok := interface{}(m.Status).(interface { + if vtmsg, ok := any(m.Status).(interface { MarshalToSizedBufferVT([]byte) (int, error) }); ok { size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) @@ -7460,7 +7533,7 @@ func (m *Object_List_Response_Status) MarshalToVT(dAtA []byte) (int, error) { func (m *Object_List_Response_Status) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) if m.Status != nil { - if vtmsg, ok := interface{}(m.Status).(interface { + if vtmsg, ok := any(m.Status).(interface { MarshalToSizedBufferVT([]byte) (int, error) }); ok { size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) @@ -7770,6 +7843,71 @@ func (m *Info_Index_Count) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Info_Index_Detail) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Info_Index_Detail) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Info_Index_Detail) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.LiveAgents != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.LiveAgents)) + i-- + dAtA[i] = 0x18 + } + if m.Replica != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Replica)) + i-- + dAtA[i] = 0x10 + } + if len(m.Counts) > 0 { + for k := range m.Counts { + v := m.Counts[k] + baseI := i + size, err := v.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *Info_Index_UUID_Committed) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -9013,7 +9151,7 @@ func (m *Search_StreamResponse_Status) SizeVT() (n int) { var l int _ = l if m.Status != nil { - if size, ok := interface{}(m.Status).(interface { + if size, ok := any(m.Status).(interface { SizeVT() int }); ok { l = size.SizeVT() @@ -9568,7 +9706,7 @@ func (m *Object_StreamDistance_Status) SizeVT() (n int) { var l int _ = l if m.Status != nil { - if size, ok := interface{}(m.Status).(interface { + if size, ok := any(m.Status).(interface { SizeVT() int }); ok { l = size.SizeVT() @@ -9629,7 +9767,7 @@ func (m *Object_Vector) SizeVT() (n int) { return n } -func (m *Object_GetTimestampRequest) SizeVT() (n int) { +func (m *Object_TimestampRequest) SizeVT() (n int) { if m == nil { return 0 } @@ -9708,7 +9846,7 @@ func (m *Object_StreamVector_Status) SizeVT() (n int) { var l int _ = l if m.Status != nil { - if size, ok := interface{}(m.Status).(interface { + if size, ok := any(m.Status).(interface { SizeVT() int }); ok { l = size.SizeVT() @@ -9790,7 +9928,7 @@ func (m *Object_StreamBlob_Status) SizeVT() (n int) { var l int _ = l if m.Status != nil { - if size, ok := interface{}(m.Status).(interface { + if size, ok := any(m.Status).(interface { SizeVT() int }); ok { l = size.SizeVT() @@ -9857,7 +9995,7 @@ func (m *Object_StreamLocation_Status) SizeVT() (n int) { var l int _ = l if m.Status != nil { - if size, ok := interface{}(m.Status).(interface { + if size, ok := any(m.Status).(interface { SizeVT() int }); ok { l = size.SizeVT() @@ -9926,7 +10064,7 @@ func (m *Object_List_Response_Status) SizeVT() (n int) { var l int _ = l if m.Status != nil { - if size, ok := interface{}(m.Status).(interface { + if size, ok := any(m.Status).(interface { SizeVT() int }); ok { l = size.SizeVT() @@ -10034,6 +10172,35 @@ func (m *Info_Index_Count) SizeVT() (n int) { return n } +func (m *Info_Index_Detail) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Counts) > 0 { + for k, v := range m.Counts { + _ = k + _ = v + l = 0 + if v != nil { + l = v.SizeVT() + } + l += 1 + protohelpers.SizeOfVarint(uint64(l)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + l + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) + } + } + if m.Replica != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Replica)) + } + if m.LiveAgents != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.LiveAgents)) + } + n += len(m.unknownFields) + return n +} + func (m *Info_Index_UUID_Committed) SizeVT() (n int) { if m == nil { return 0 @@ -11673,7 +11840,7 @@ func (m *Search_StreamResponse) UnmarshalVT(dAtA []byte) error { return io.ErrUnexpectedEOF } if oneof, ok := m.Payload.(*Search_StreamResponse_Status); ok { - if unmarshal, ok := interface{}(oneof.Status).(interface { + if unmarshal, ok := any(oneof.Status).(interface { UnmarshalVT([]byte) error }); ok { if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { @@ -11686,7 +11853,7 @@ func (m *Search_StreamResponse) UnmarshalVT(dAtA []byte) error { } } else { v := &status.Status{} - if unmarshal, ok := interface{}(v).(interface { + if unmarshal, ok := any(v).(interface { UnmarshalVT([]byte) error }); ok { if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { @@ -14880,7 +15047,7 @@ func (m *Object_StreamDistance) UnmarshalVT(dAtA []byte) error { return io.ErrUnexpectedEOF } if oneof, ok := m.Payload.(*Object_StreamDistance_Status); ok { - if unmarshal, ok := interface{}(oneof.Status).(interface { + if unmarshal, ok := any(oneof.Status).(interface { UnmarshalVT([]byte) error }); ok { if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { @@ -14893,7 +15060,7 @@ func (m *Object_StreamDistance) UnmarshalVT(dAtA []byte) error { } } else { v := &status.Status{} - if unmarshal, ok := interface{}(v).(interface { + if unmarshal, ok := any(v).(interface { UnmarshalVT([]byte) error }); ok { if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { @@ -15251,7 +15418,7 @@ func (m *Object_Vector) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *Object_GetTimestampRequest) UnmarshalVT(dAtA []byte) error { +func (m *Object_TimestampRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -15274,10 +15441,10 @@ func (m *Object_GetTimestampRequest) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Object_GetTimestampRequest: wiretype end group for non-group") + return fmt.Errorf("proto: Object_TimestampRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Object_GetTimestampRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Object_TimestampRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -15625,7 +15792,7 @@ func (m *Object_StreamVector) UnmarshalVT(dAtA []byte) error { return io.ErrUnexpectedEOF } if oneof, ok := m.Payload.(*Object_StreamVector_Status); ok { - if unmarshal, ok := interface{}(oneof.Status).(interface { + if unmarshal, ok := any(oneof.Status).(interface { UnmarshalVT([]byte) error }); ok { if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { @@ -15638,7 +15805,7 @@ func (m *Object_StreamVector) UnmarshalVT(dAtA []byte) error { } } else { v := &status.Status{} - if unmarshal, ok := interface{}(v).(interface { + if unmarshal, ok := any(v).(interface { UnmarshalVT([]byte) error }); ok { if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { @@ -16052,7 +16219,7 @@ func (m *Object_StreamBlob) UnmarshalVT(dAtA []byte) error { return io.ErrUnexpectedEOF } if oneof, ok := m.Payload.(*Object_StreamBlob_Status); ok { - if unmarshal, ok := interface{}(oneof.Status).(interface { + if unmarshal, ok := any(oneof.Status).(interface { UnmarshalVT([]byte) error }); ok { if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { @@ -16065,7 +16232,7 @@ func (m *Object_StreamBlob) UnmarshalVT(dAtA []byte) error { } } else { v := &status.Status{} - if unmarshal, ok := interface{}(v).(interface { + if unmarshal, ok := any(v).(interface { UnmarshalVT([]byte) error }); ok { if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { @@ -16348,7 +16515,7 @@ func (m *Object_StreamLocation) UnmarshalVT(dAtA []byte) error { return io.ErrUnexpectedEOF } if oneof, ok := m.Payload.(*Object_StreamLocation_Status); ok { - if unmarshal, ok := interface{}(oneof.Status).(interface { + if unmarshal, ok := any(oneof.Status).(interface { UnmarshalVT([]byte) error }); ok { if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { @@ -16361,7 +16528,7 @@ func (m *Object_StreamLocation) UnmarshalVT(dAtA []byte) error { } } else { v := &status.Status{} - if unmarshal, ok := interface{}(v).(interface { + if unmarshal, ok := any(v).(interface { UnmarshalVT([]byte) error }); ok { if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { @@ -16633,7 +16800,7 @@ func (m *Object_List_Response) UnmarshalVT(dAtA []byte) error { return io.ErrUnexpectedEOF } if oneof, ok := m.Payload.(*Object_List_Response_Status); ok { - if unmarshal, ok := interface{}(oneof.Status).(interface { + if unmarshal, ok := any(oneof.Status).(interface { UnmarshalVT([]byte) error }); ok { if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { @@ -16646,7 +16813,7 @@ func (m *Object_List_Response) UnmarshalVT(dAtA []byte) error { } } else { v := &status.Status{} - if unmarshal, ok := interface{}(v).(interface { + if unmarshal, ok := any(v).(interface { UnmarshalVT([]byte) error }); ok { if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { @@ -17232,6 +17399,224 @@ func (m *Info_Index_Count) UnmarshalVT(dAtA []byte) error { } return nil } +func (m *Info_Index_Detail) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Info_Index_Detail: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Info_Index_Detail: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Counts", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Counts == nil { + m.Counts = make(map[string]*Info_Index_Count) + } + var mapkey string + var mapvalue *Info_Index_Count + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return protohelpers.ErrInvalidLength + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &Info_Index_Count{} + if err := mapvalue.UnmarshalVT(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Counts[mapkey] = mapvalue + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Replica", wireType) + } + m.Replica = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Replica |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LiveAgents", wireType) + } + m.LiveAgents = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LiveAgents |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *Info_Index_UUID_Committed) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/apis/grpc/v1/rpc/errdetails/error_details.pb.go b/apis/grpc/v1/rpc/errdetails/error_details.pb.go index c126c47fa86..810ebcbd5a5 100644 --- a/apis/grpc/v1/rpc/errdetails/error_details.pb.go +++ b/apis/grpc/v1/rpc/errdetails/error_details.pb.go @@ -1,5 +1,6 @@ // -// Copyright (C) 2019-2024 vdaas.org vald team +// Copyright (C) 2024 Google LLC +// Modified by 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. @@ -16,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 +// protoc-gen-go v1.34.2 // protoc (unknown) // source: v1/rpc/errdetails/error_details.proto @@ -1087,7 +1088,7 @@ func file_v1_rpc_errdetails_error_details_proto_rawDescGZIP() []byte { } var file_v1_rpc_errdetails_error_details_proto_msgTypes = make([]protoimpl.MessageInfo, 15) -var file_v1_rpc_errdetails_error_details_proto_goTypes = []interface{}{ +var file_v1_rpc_errdetails_error_details_proto_goTypes = []any{ (*ErrorInfo)(nil), // 0: rpc.v1.ErrorInfo (*RetryInfo)(nil), // 1: rpc.v1.RetryInfo (*DebugInfo)(nil), // 2: rpc.v1.DebugInfo @@ -1125,7 +1126,7 @@ func file_v1_rpc_errdetails_error_details_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_v1_rpc_errdetails_error_details_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_v1_rpc_errdetails_error_details_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*ErrorInfo); i { case 0: return &v.state @@ -1137,7 +1138,7 @@ func file_v1_rpc_errdetails_error_details_proto_init() { return nil } } - file_v1_rpc_errdetails_error_details_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_v1_rpc_errdetails_error_details_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*RetryInfo); i { case 0: return &v.state @@ -1149,7 +1150,7 @@ func file_v1_rpc_errdetails_error_details_proto_init() { return nil } } - file_v1_rpc_errdetails_error_details_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_v1_rpc_errdetails_error_details_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*DebugInfo); i { case 0: return &v.state @@ -1161,7 +1162,7 @@ func file_v1_rpc_errdetails_error_details_proto_init() { return nil } } - file_v1_rpc_errdetails_error_details_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_v1_rpc_errdetails_error_details_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*QuotaFailure); i { case 0: return &v.state @@ -1173,7 +1174,7 @@ func file_v1_rpc_errdetails_error_details_proto_init() { return nil } } - file_v1_rpc_errdetails_error_details_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_v1_rpc_errdetails_error_details_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*PreconditionFailure); i { case 0: return &v.state @@ -1185,7 +1186,7 @@ func file_v1_rpc_errdetails_error_details_proto_init() { return nil } } - file_v1_rpc_errdetails_error_details_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_v1_rpc_errdetails_error_details_proto_msgTypes[5].Exporter = func(v any, i int) any { switch v := v.(*BadRequest); i { case 0: return &v.state @@ -1197,7 +1198,7 @@ func file_v1_rpc_errdetails_error_details_proto_init() { return nil } } - file_v1_rpc_errdetails_error_details_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_v1_rpc_errdetails_error_details_proto_msgTypes[6].Exporter = func(v any, i int) any { switch v := v.(*RequestInfo); i { case 0: return &v.state @@ -1209,7 +1210,7 @@ func file_v1_rpc_errdetails_error_details_proto_init() { return nil } } - file_v1_rpc_errdetails_error_details_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_v1_rpc_errdetails_error_details_proto_msgTypes[7].Exporter = func(v any, i int) any { switch v := v.(*ResourceInfo); i { case 0: return &v.state @@ -1221,7 +1222,7 @@ func file_v1_rpc_errdetails_error_details_proto_init() { return nil } } - file_v1_rpc_errdetails_error_details_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_v1_rpc_errdetails_error_details_proto_msgTypes[8].Exporter = func(v any, i int) any { switch v := v.(*Help); i { case 0: return &v.state @@ -1233,7 +1234,7 @@ func file_v1_rpc_errdetails_error_details_proto_init() { return nil } } - file_v1_rpc_errdetails_error_details_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_v1_rpc_errdetails_error_details_proto_msgTypes[9].Exporter = func(v any, i int) any { switch v := v.(*LocalizedMessage); i { case 0: return &v.state @@ -1245,7 +1246,7 @@ func file_v1_rpc_errdetails_error_details_proto_init() { return nil } } - file_v1_rpc_errdetails_error_details_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_v1_rpc_errdetails_error_details_proto_msgTypes[11].Exporter = func(v any, i int) any { switch v := v.(*QuotaFailure_Violation); i { case 0: return &v.state @@ -1257,7 +1258,7 @@ func file_v1_rpc_errdetails_error_details_proto_init() { return nil } } - file_v1_rpc_errdetails_error_details_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_v1_rpc_errdetails_error_details_proto_msgTypes[12].Exporter = func(v any, i int) any { switch v := v.(*PreconditionFailure_Violation); i { case 0: return &v.state @@ -1269,7 +1270,7 @@ func file_v1_rpc_errdetails_error_details_proto_init() { return nil } } - file_v1_rpc_errdetails_error_details_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_v1_rpc_errdetails_error_details_proto_msgTypes[13].Exporter = func(v any, i int) any { switch v := v.(*BadRequest_FieldViolation); i { case 0: return &v.state @@ -1281,7 +1282,7 @@ func file_v1_rpc_errdetails_error_details_proto_init() { return nil } } - file_v1_rpc_errdetails_error_details_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_v1_rpc_errdetails_error_details_proto_msgTypes[14].Exporter = func(v any, i int) any { switch v := v.(*Help_Link); i { case 0: return &v.state diff --git a/apis/grpc/v1/rpc/errdetails/error_details.pb.json.go b/apis/grpc/v1/rpc/errdetails/error_details.pb.json.go index 1829998e8b8..8aad832ca97 100644 --- a/apis/grpc/v1/rpc/errdetails/error_details.pb.json.go +++ b/apis/grpc/v1/rpc/errdetails/error_details.pb.json.go @@ -1,5 +1,6 @@ // -// Copyright (C) 2019-2024 vdaas.org vald team +// Copyright (C) 2024 Google LLC +// Modified by 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. @@ -19,9 +20,7 @@ package errdetails -import ( - "google.golang.org/protobuf/encoding/protojson" -) +import "google.golang.org/protobuf/encoding/protojson" // MarshalJSON implements json.Marshaler func (msg *ErrorInfo) MarshalJSON() ([]byte, error) { diff --git a/apis/grpc/v1/rpc/errdetails/error_details_vtproto.pb.go b/apis/grpc/v1/rpc/errdetails/error_details_vtproto.pb.go index 27e9c07ef95..0127478783f 100644 --- a/apis/grpc/v1/rpc/errdetails/error_details_vtproto.pb.go +++ b/apis/grpc/v1/rpc/errdetails/error_details_vtproto.pb.go @@ -1,5 +1,6 @@ // -// Copyright (C) 2019-2024 vdaas.org vald team +// Copyright (C) 2024 Google LLC +// Modified by 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. diff --git a/apis/grpc/v1/vald/filter.pb.go b/apis/grpc/v1/vald/filter.pb.go index 162881bc5ef..9ccddf71408 100644 --- a/apis/grpc/v1/vald/filter.pb.go +++ b/apis/grpc/v1/vald/filter.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 +// protoc-gen-go v1.34.2 // protoc (unknown) // source: v1/vald/filter.proto @@ -138,7 +138,7 @@ var file_v1_vald_filter_proto_rawDesc = []byte{ 0x74, 0x6f, 0x33, } -var file_v1_vald_filter_proto_goTypes = []interface{}{ +var file_v1_vald_filter_proto_goTypes = []any{ (*payload.Search_ObjectRequest)(nil), // 0: payload.v1.Search.ObjectRequest (*payload.Search_MultiObjectRequest)(nil), // 1: payload.v1.Search.MultiObjectRequest (*payload.Insert_ObjectRequest)(nil), // 2: payload.v1.Insert.ObjectRequest diff --git a/apis/grpc/v1/vald/filter_vtproto.pb.go b/apis/grpc/v1/vald/filter_vtproto.pb.go index 7c8afdeb3ac..a73d2576fdd 100644 --- a/apis/grpc/v1/vald/filter_vtproto.pb.go +++ b/apis/grpc/v1/vald/filter_vtproto.pb.go @@ -76,7 +76,9 @@ func NewFilterClient(cc grpc.ClientConnInterface) FilterClient { return &filterClient{cc} } -func (c *filterClient) SearchObject(ctx context.Context, in *payload.Search_ObjectRequest, opts ...grpc.CallOption) (*payload.Search_Response, error) { +func (c *filterClient) SearchObject( + ctx context.Context, in *payload.Search_ObjectRequest, opts ...grpc.CallOption, +) (*payload.Search_Response, error) { out := new(payload.Search_Response) err := c.cc.Invoke(ctx, "/vald.v1.Filter/SearchObject", in, out, opts...) if err != nil { @@ -85,7 +87,9 @@ func (c *filterClient) SearchObject(ctx context.Context, in *payload.Search_Obje return out, nil } -func (c *filterClient) MultiSearchObject(ctx context.Context, in *payload.Search_MultiObjectRequest, opts ...grpc.CallOption) (*payload.Search_Responses, error) { +func (c *filterClient) MultiSearchObject( + ctx context.Context, in *payload.Search_MultiObjectRequest, opts ...grpc.CallOption, +) (*payload.Search_Responses, error) { out := new(payload.Search_Responses) err := c.cc.Invoke(ctx, "/vald.v1.Filter/MultiSearchObject", in, out, opts...) if err != nil { @@ -94,7 +98,9 @@ func (c *filterClient) MultiSearchObject(ctx context.Context, in *payload.Search return out, nil } -func (c *filterClient) StreamSearchObject(ctx context.Context, opts ...grpc.CallOption) (Filter_StreamSearchObjectClient, error) { +func (c *filterClient) StreamSearchObject( + ctx context.Context, opts ...grpc.CallOption, +) (Filter_StreamSearchObjectClient, error) { stream, err := c.cc.NewStream(ctx, &Filter_ServiceDesc.Streams[0], "/vald.v1.Filter/StreamSearchObject", opts...) if err != nil { return nil, err @@ -125,7 +131,9 @@ func (x *filterStreamSearchObjectClient) Recv() (*payload.Search_StreamResponse, return m, nil } -func (c *filterClient) InsertObject(ctx context.Context, in *payload.Insert_ObjectRequest, opts ...grpc.CallOption) (*payload.Object_Location, error) { +func (c *filterClient) InsertObject( + ctx context.Context, in *payload.Insert_ObjectRequest, opts ...grpc.CallOption, +) (*payload.Object_Location, error) { out := new(payload.Object_Location) err := c.cc.Invoke(ctx, "/vald.v1.Filter/InsertObject", in, out, opts...) if err != nil { @@ -134,7 +142,9 @@ func (c *filterClient) InsertObject(ctx context.Context, in *payload.Insert_Obje return out, nil } -func (c *filterClient) StreamInsertObject(ctx context.Context, opts ...grpc.CallOption) (Filter_StreamInsertObjectClient, error) { +func (c *filterClient) StreamInsertObject( + ctx context.Context, opts ...grpc.CallOption, +) (Filter_StreamInsertObjectClient, error) { stream, err := c.cc.NewStream(ctx, &Filter_ServiceDesc.Streams[1], "/vald.v1.Filter/StreamInsertObject", opts...) if err != nil { return nil, err @@ -165,7 +175,9 @@ func (x *filterStreamInsertObjectClient) Recv() (*payload.Object_StreamLocation, return m, nil } -func (c *filterClient) MultiInsertObject(ctx context.Context, in *payload.Insert_MultiObjectRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) { +func (c *filterClient) MultiInsertObject( + ctx context.Context, in *payload.Insert_MultiObjectRequest, opts ...grpc.CallOption, +) (*payload.Object_Locations, error) { out := new(payload.Object_Locations) err := c.cc.Invoke(ctx, "/vald.v1.Filter/MultiInsertObject", in, out, opts...) if err != nil { @@ -174,7 +186,9 @@ func (c *filterClient) MultiInsertObject(ctx context.Context, in *payload.Insert return out, nil } -func (c *filterClient) UpdateObject(ctx context.Context, in *payload.Update_ObjectRequest, opts ...grpc.CallOption) (*payload.Object_Location, error) { +func (c *filterClient) UpdateObject( + ctx context.Context, in *payload.Update_ObjectRequest, opts ...grpc.CallOption, +) (*payload.Object_Location, error) { out := new(payload.Object_Location) err := c.cc.Invoke(ctx, "/vald.v1.Filter/UpdateObject", in, out, opts...) if err != nil { @@ -183,7 +197,9 @@ func (c *filterClient) UpdateObject(ctx context.Context, in *payload.Update_Obje return out, nil } -func (c *filterClient) StreamUpdateObject(ctx context.Context, opts ...grpc.CallOption) (Filter_StreamUpdateObjectClient, error) { +func (c *filterClient) StreamUpdateObject( + ctx context.Context, opts ...grpc.CallOption, +) (Filter_StreamUpdateObjectClient, error) { stream, err := c.cc.NewStream(ctx, &Filter_ServiceDesc.Streams[2], "/vald.v1.Filter/StreamUpdateObject", opts...) if err != nil { return nil, err @@ -214,7 +230,9 @@ func (x *filterStreamUpdateObjectClient) Recv() (*payload.Object_StreamLocation, return m, nil } -func (c *filterClient) MultiUpdateObject(ctx context.Context, in *payload.Update_MultiObjectRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) { +func (c *filterClient) MultiUpdateObject( + ctx context.Context, in *payload.Update_MultiObjectRequest, opts ...grpc.CallOption, +) (*payload.Object_Locations, error) { out := new(payload.Object_Locations) err := c.cc.Invoke(ctx, "/vald.v1.Filter/MultiUpdateObject", in, out, opts...) if err != nil { @@ -223,7 +241,9 @@ func (c *filterClient) MultiUpdateObject(ctx context.Context, in *payload.Update return out, nil } -func (c *filterClient) UpsertObject(ctx context.Context, in *payload.Upsert_ObjectRequest, opts ...grpc.CallOption) (*payload.Object_Location, error) { +func (c *filterClient) UpsertObject( + ctx context.Context, in *payload.Upsert_ObjectRequest, opts ...grpc.CallOption, +) (*payload.Object_Location, error) { out := new(payload.Object_Location) err := c.cc.Invoke(ctx, "/vald.v1.Filter/UpsertObject", in, out, opts...) if err != nil { @@ -232,7 +252,9 @@ func (c *filterClient) UpsertObject(ctx context.Context, in *payload.Upsert_Obje return out, nil } -func (c *filterClient) StreamUpsertObject(ctx context.Context, opts ...grpc.CallOption) (Filter_StreamUpsertObjectClient, error) { +func (c *filterClient) StreamUpsertObject( + ctx context.Context, opts ...grpc.CallOption, +) (Filter_StreamUpsertObjectClient, error) { stream, err := c.cc.NewStream(ctx, &Filter_ServiceDesc.Streams[3], "/vald.v1.Filter/StreamUpsertObject", opts...) if err != nil { return nil, err @@ -263,7 +285,9 @@ func (x *filterStreamUpsertObjectClient) Recv() (*payload.Object_StreamLocation, return m, nil } -func (c *filterClient) MultiUpsertObject(ctx context.Context, in *payload.Upsert_MultiObjectRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) { +func (c *filterClient) MultiUpsertObject( + ctx context.Context, in *payload.Upsert_MultiObjectRequest, opts ...grpc.CallOption, +) (*payload.Object_Locations, error) { out := new(payload.Object_Locations) err := c.cc.Invoke(ctx, "/vald.v1.Filter/MultiUpsertObject", in, out, opts...) if err != nil { @@ -307,40 +331,56 @@ type FilterServer interface { type UnimplementedFilterServer struct { } -func (UnimplementedFilterServer) SearchObject(context.Context, *payload.Search_ObjectRequest) (*payload.Search_Response, error) { +func (UnimplementedFilterServer) SearchObject( + context.Context, *payload.Search_ObjectRequest, +) (*payload.Search_Response, error) { return nil, status.Errorf(codes.Unimplemented, "method SearchObject not implemented") } -func (UnimplementedFilterServer) MultiSearchObject(context.Context, *payload.Search_MultiObjectRequest) (*payload.Search_Responses, error) { +func (UnimplementedFilterServer) MultiSearchObject( + context.Context, *payload.Search_MultiObjectRequest, +) (*payload.Search_Responses, error) { return nil, status.Errorf(codes.Unimplemented, "method MultiSearchObject not implemented") } func (UnimplementedFilterServer) StreamSearchObject(Filter_StreamSearchObjectServer) error { return status.Errorf(codes.Unimplemented, "method StreamSearchObject not implemented") } -func (UnimplementedFilterServer) InsertObject(context.Context, *payload.Insert_ObjectRequest) (*payload.Object_Location, error) { +func (UnimplementedFilterServer) InsertObject( + context.Context, *payload.Insert_ObjectRequest, +) (*payload.Object_Location, error) { return nil, status.Errorf(codes.Unimplemented, "method InsertObject not implemented") } func (UnimplementedFilterServer) StreamInsertObject(Filter_StreamInsertObjectServer) error { return status.Errorf(codes.Unimplemented, "method StreamInsertObject not implemented") } -func (UnimplementedFilterServer) MultiInsertObject(context.Context, *payload.Insert_MultiObjectRequest) (*payload.Object_Locations, error) { +func (UnimplementedFilterServer) MultiInsertObject( + context.Context, *payload.Insert_MultiObjectRequest, +) (*payload.Object_Locations, error) { return nil, status.Errorf(codes.Unimplemented, "method MultiInsertObject not implemented") } -func (UnimplementedFilterServer) UpdateObject(context.Context, *payload.Update_ObjectRequest) (*payload.Object_Location, error) { +func (UnimplementedFilterServer) UpdateObject( + context.Context, *payload.Update_ObjectRequest, +) (*payload.Object_Location, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateObject not implemented") } func (UnimplementedFilterServer) StreamUpdateObject(Filter_StreamUpdateObjectServer) error { return status.Errorf(codes.Unimplemented, "method StreamUpdateObject not implemented") } -func (UnimplementedFilterServer) MultiUpdateObject(context.Context, *payload.Update_MultiObjectRequest) (*payload.Object_Locations, error) { +func (UnimplementedFilterServer) MultiUpdateObject( + context.Context, *payload.Update_MultiObjectRequest, +) (*payload.Object_Locations, error) { return nil, status.Errorf(codes.Unimplemented, "method MultiUpdateObject not implemented") } -func (UnimplementedFilterServer) UpsertObject(context.Context, *payload.Upsert_ObjectRequest) (*payload.Object_Location, error) { +func (UnimplementedFilterServer) UpsertObject( + context.Context, *payload.Upsert_ObjectRequest, +) (*payload.Object_Location, error) { return nil, status.Errorf(codes.Unimplemented, "method UpsertObject not implemented") } func (UnimplementedFilterServer) StreamUpsertObject(Filter_StreamUpsertObjectServer) error { return status.Errorf(codes.Unimplemented, "method StreamUpsertObject not implemented") } -func (UnimplementedFilterServer) MultiUpsertObject(context.Context, *payload.Upsert_MultiObjectRequest) (*payload.Object_Locations, error) { +func (UnimplementedFilterServer) MultiUpsertObject( + context.Context, *payload.Upsert_MultiObjectRequest, +) (*payload.Object_Locations, error) { return nil, status.Errorf(codes.Unimplemented, "method MultiUpsertObject not implemented") } func (UnimplementedFilterServer) mustEmbedUnimplementedFilterServer() {} @@ -356,7 +396,9 @@ func RegisterFilterServer(s grpc.ServiceRegistrar, srv FilterServer) { s.RegisterService(&Filter_ServiceDesc, srv) } -func _Filter_SearchObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Filter_SearchObject_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Search_ObjectRequest) if err := dec(in); err != nil { return nil, err @@ -368,13 +410,15 @@ func _Filter_SearchObject_Handler(srv interface{}, ctx context.Context, dec func Server: srv, FullMethod: "/vald.v1.Filter/SearchObject", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(FilterServer).SearchObject(ctx, req.(*payload.Search_ObjectRequest)) } return interceptor(ctx, in, info, handler) } -func _Filter_MultiSearchObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Filter_MultiSearchObject_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Search_MultiObjectRequest) if err := dec(in); err != nil { return nil, err @@ -386,13 +430,13 @@ func _Filter_MultiSearchObject_Handler(srv interface{}, ctx context.Context, dec Server: srv, FullMethod: "/vald.v1.Filter/MultiSearchObject", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(FilterServer).MultiSearchObject(ctx, req.(*payload.Search_MultiObjectRequest)) } return interceptor(ctx, in, info, handler) } -func _Filter_StreamSearchObject_Handler(srv interface{}, stream grpc.ServerStream) error { +func _Filter_StreamSearchObject_Handler(srv any, stream grpc.ServerStream) error { return srv.(FilterServer).StreamSearchObject(&filterStreamSearchObjectServer{stream}) } @@ -418,7 +462,9 @@ func (x *filterStreamSearchObjectServer) Recv() (*payload.Search_ObjectRequest, return m, nil } -func _Filter_InsertObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Filter_InsertObject_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Insert_ObjectRequest) if err := dec(in); err != nil { return nil, err @@ -430,13 +476,13 @@ func _Filter_InsertObject_Handler(srv interface{}, ctx context.Context, dec func Server: srv, FullMethod: "/vald.v1.Filter/InsertObject", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(FilterServer).InsertObject(ctx, req.(*payload.Insert_ObjectRequest)) } return interceptor(ctx, in, info, handler) } -func _Filter_StreamInsertObject_Handler(srv interface{}, stream grpc.ServerStream) error { +func _Filter_StreamInsertObject_Handler(srv any, stream grpc.ServerStream) error { return srv.(FilterServer).StreamInsertObject(&filterStreamInsertObjectServer{stream}) } @@ -462,7 +508,9 @@ func (x *filterStreamInsertObjectServer) Recv() (*payload.Insert_ObjectRequest, return m, nil } -func _Filter_MultiInsertObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Filter_MultiInsertObject_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Insert_MultiObjectRequest) if err := dec(in); err != nil { return nil, err @@ -474,13 +522,15 @@ func _Filter_MultiInsertObject_Handler(srv interface{}, ctx context.Context, dec Server: srv, FullMethod: "/vald.v1.Filter/MultiInsertObject", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(FilterServer).MultiInsertObject(ctx, req.(*payload.Insert_MultiObjectRequest)) } return interceptor(ctx, in, info, handler) } -func _Filter_UpdateObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Filter_UpdateObject_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Update_ObjectRequest) if err := dec(in); err != nil { return nil, err @@ -492,13 +542,13 @@ func _Filter_UpdateObject_Handler(srv interface{}, ctx context.Context, dec func Server: srv, FullMethod: "/vald.v1.Filter/UpdateObject", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(FilterServer).UpdateObject(ctx, req.(*payload.Update_ObjectRequest)) } return interceptor(ctx, in, info, handler) } -func _Filter_StreamUpdateObject_Handler(srv interface{}, stream grpc.ServerStream) error { +func _Filter_StreamUpdateObject_Handler(srv any, stream grpc.ServerStream) error { return srv.(FilterServer).StreamUpdateObject(&filterStreamUpdateObjectServer{stream}) } @@ -524,7 +574,9 @@ func (x *filterStreamUpdateObjectServer) Recv() (*payload.Update_ObjectRequest, return m, nil } -func _Filter_MultiUpdateObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Filter_MultiUpdateObject_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Update_MultiObjectRequest) if err := dec(in); err != nil { return nil, err @@ -536,13 +588,15 @@ func _Filter_MultiUpdateObject_Handler(srv interface{}, ctx context.Context, dec Server: srv, FullMethod: "/vald.v1.Filter/MultiUpdateObject", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(FilterServer).MultiUpdateObject(ctx, req.(*payload.Update_MultiObjectRequest)) } return interceptor(ctx, in, info, handler) } -func _Filter_UpsertObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Filter_UpsertObject_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Upsert_ObjectRequest) if err := dec(in); err != nil { return nil, err @@ -554,13 +608,13 @@ func _Filter_UpsertObject_Handler(srv interface{}, ctx context.Context, dec func Server: srv, FullMethod: "/vald.v1.Filter/UpsertObject", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(FilterServer).UpsertObject(ctx, req.(*payload.Upsert_ObjectRequest)) } return interceptor(ctx, in, info, handler) } -func _Filter_StreamUpsertObject_Handler(srv interface{}, stream grpc.ServerStream) error { +func _Filter_StreamUpsertObject_Handler(srv any, stream grpc.ServerStream) error { return srv.(FilterServer).StreamUpsertObject(&filterStreamUpsertObjectServer{stream}) } @@ -586,7 +640,9 @@ func (x *filterStreamUpsertObjectServer) Recv() (*payload.Upsert_ObjectRequest, return m, nil } -func _Filter_MultiUpsertObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Filter_MultiUpsertObject_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Upsert_MultiObjectRequest) if err := dec(in); err != nil { return nil, err @@ -598,7 +654,7 @@ func _Filter_MultiUpsertObject_Handler(srv interface{}, ctx context.Context, dec Server: srv, FullMethod: "/vald.v1.Filter/MultiUpsertObject", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(FilterServer).MultiUpsertObject(ctx, req.(*payload.Upsert_MultiObjectRequest)) } return interceptor(ctx, in, info, handler) diff --git a/apis/grpc/v1/vald/flush.pb.go b/apis/grpc/v1/vald/flush.pb.go index a2afd364917..0091641d776 100644 --- a/apis/grpc/v1/vald/flush.pb.go +++ b/apis/grpc/v1/vald/flush.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 +// protoc-gen-go v1.34.2 // protoc (unknown) // source: v1/vald/flush.proto @@ -60,7 +60,7 @@ var file_v1_vald_flush_proto_rawDesc = []byte{ 0x2f, 0x76, 0x61, 0x6c, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -var file_v1_vald_flush_proto_goTypes = []interface{}{ +var file_v1_vald_flush_proto_goTypes = []any{ (*payload.Flush_Request)(nil), // 0: payload.v1.Flush.Request (*payload.Info_Index_Count)(nil), // 1: payload.v1.Info.Index.Count } diff --git a/apis/grpc/v1/vald/flush_vtproto.pb.go b/apis/grpc/v1/vald/flush_vtproto.pb.go index e4ed9aeffc0..29a8ac2a900 100644 --- a/apis/grpc/v1/vald/flush_vtproto.pb.go +++ b/apis/grpc/v1/vald/flush_vtproto.pb.go @@ -54,7 +54,9 @@ func NewFlushClient(cc grpc.ClientConnInterface) FlushClient { return &flushClient{cc} } -func (c *flushClient) Flush(ctx context.Context, in *payload.Flush_Request, opts ...grpc.CallOption) (*payload.Info_Index_Count, error) { +func (c *flushClient) Flush( + ctx context.Context, in *payload.Flush_Request, opts ...grpc.CallOption, +) (*payload.Info_Index_Count, error) { out := new(payload.Info_Index_Count) err := c.cc.Invoke(ctx, "/vald.v1.Flush/Flush", in, out, opts...) if err != nil { @@ -76,7 +78,9 @@ type FlushServer interface { type UnimplementedFlushServer struct { } -func (UnimplementedFlushServer) Flush(context.Context, *payload.Flush_Request) (*payload.Info_Index_Count, error) { +func (UnimplementedFlushServer) Flush( + context.Context, *payload.Flush_Request, +) (*payload.Info_Index_Count, error) { return nil, status.Errorf(codes.Unimplemented, "method Flush not implemented") } func (UnimplementedFlushServer) mustEmbedUnimplementedFlushServer() {} @@ -92,7 +96,9 @@ func RegisterFlushServer(s grpc.ServiceRegistrar, srv FlushServer) { s.RegisterService(&Flush_ServiceDesc, srv) } -func _Flush_Flush_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Flush_Flush_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Flush_Request) if err := dec(in); err != nil { return nil, err @@ -104,7 +110,7 @@ func _Flush_Flush_Handler(srv interface{}, ctx context.Context, dec func(interfa Server: srv, FullMethod: "/vald.v1.Flush/Flush", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(FlushServer).Flush(ctx, req.(*payload.Flush_Request)) } return interceptor(ctx, in, info, handler) diff --git a/apis/grpc/v1/vald/index.pb.go b/apis/grpc/v1/vald/index.pb.go new file mode 100644 index 00000000000..624f1336d2c --- /dev/null +++ b/apis/grpc/v1/vald/index.pb.go @@ -0,0 +1,108 @@ +// +// 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. +// + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc (unknown) +// source: v1/vald/index.proto + +package vald + +import ( + reflect "reflect" + + payload "github.com/vdaas/vald/apis/grpc/v1/payload" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_v1_vald_index_proto protoreflect.FileDescriptor + +var file_v1_vald_index_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x76, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x64, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x76, 0x61, 0x6c, 0x64, 0x2e, 0x76, 0x31, 0x1a, 0x1c, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x76, 0x31, + 0x2f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xb2, 0x01, 0x0a, 0x05, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x12, 0x51, 0x0a, 0x09, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x11, 0x2e, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x1a, 0x1c, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, + 0x66, 0x6f, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x13, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x12, 0x0b, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2f, 0x69, + 0x6e, 0x66, 0x6f, 0x12, 0x56, 0x0a, 0x0b, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x44, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x12, 0x11, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1d, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x44, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x69, + 0x6e, 0x64, 0x65, 0x78, 0x2f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x42, 0x52, 0x0a, 0x1a, 0x6f, + 0x72, 0x67, 0x2e, 0x76, 0x64, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x61, 0x6c, 0x64, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x76, 0x61, 0x6c, 0x64, 0x42, 0x09, 0x56, 0x61, 0x6c, 0x64, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x76, 0x64, 0x61, 0x61, 0x73, 0x2f, 0x76, 0x61, 0x6c, 0x64, 0x2f, 0x61, 0x70, + 0x69, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x64, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_v1_vald_index_proto_goTypes = []any{ + (*payload.Empty)(nil), // 0: payload.v1.Empty + (*payload.Info_Index_Count)(nil), // 1: payload.v1.Info.Index.Count + (*payload.Info_Index_Detail)(nil), // 2: payload.v1.Info.Index.Detail +} +var file_v1_vald_index_proto_depIdxs = []int32{ + 0, // 0: vald.v1.Index.IndexInfo:input_type -> payload.v1.Empty + 0, // 1: vald.v1.Index.IndexDetail:input_type -> payload.v1.Empty + 1, // 2: vald.v1.Index.IndexInfo:output_type -> payload.v1.Info.Index.Count + 2, // 3: vald.v1.Index.IndexDetail:output_type -> payload.v1.Info.Index.Detail + 2, // [2:4] is the sub-list for method output_type + 0, // [0:2] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_v1_vald_index_proto_init() } +func file_v1_vald_index_proto_init() { + if File_v1_vald_index_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_v1_vald_index_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_v1_vald_index_proto_goTypes, + DependencyIndexes: file_v1_vald_index_proto_depIdxs, + }.Build() + File_v1_vald_index_proto = out.File + file_v1_vald_index_proto_rawDesc = nil + file_v1_vald_index_proto_goTypes = nil + file_v1_vald_index_proto_depIdxs = nil +} diff --git a/apis/grpc/v1/manager/index/index_manager_vtproto.pb.go b/apis/grpc/v1/vald/index_vtproto.pb.go similarity index 63% rename from apis/grpc/v1/manager/index/index_manager_vtproto.pb.go rename to apis/grpc/v1/vald/index_vtproto.pb.go index b88016d3291..ae10c650156 100644 --- a/apis/grpc/v1/manager/index/index_manager_vtproto.pb.go +++ b/apis/grpc/v1/vald/index_vtproto.pb.go @@ -14,7 +14,7 @@ // limitations under the License. // -package index +package vald import ( context "context" @@ -44,6 +44,8 @@ const _ = grpc.SupportPackageIsVersion7 type IndexClient interface { // Represent the RPC to get the index information. IndexInfo(ctx context.Context, in *payload.Empty, opts ...grpc.CallOption) (*payload.Info_Index_Count, error) + // Represent the RPC to get the index information for each agents. + IndexDetail(ctx context.Context, in *payload.Empty, opts ...grpc.CallOption) (*payload.Info_Index_Detail, error) } type indexClient struct { @@ -54,9 +56,22 @@ func NewIndexClient(cc grpc.ClientConnInterface) IndexClient { return &indexClient{cc} } -func (c *indexClient) IndexInfo(ctx context.Context, in *payload.Empty, opts ...grpc.CallOption) (*payload.Info_Index_Count, error) { +func (c *indexClient) IndexInfo( + ctx context.Context, in *payload.Empty, opts ...grpc.CallOption, +) (*payload.Info_Index_Count, error) { out := new(payload.Info_Index_Count) - err := c.cc.Invoke(ctx, "/manager.index.v1.Index/IndexInfo", in, out, opts...) + err := c.cc.Invoke(ctx, "/vald.v1.Index/IndexInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *indexClient) IndexDetail( + ctx context.Context, in *payload.Empty, opts ...grpc.CallOption, +) (*payload.Info_Index_Detail, error) { + out := new(payload.Info_Index_Detail) + err := c.cc.Invoke(ctx, "/vald.v1.Index/IndexDetail", in, out, opts...) if err != nil { return nil, err } @@ -69,6 +84,8 @@ func (c *indexClient) IndexInfo(ctx context.Context, in *payload.Empty, opts ... type IndexServer interface { // Represent the RPC to get the index information. IndexInfo(context.Context, *payload.Empty) (*payload.Info_Index_Count, error) + // Represent the RPC to get the index information for each agents. + IndexDetail(context.Context, *payload.Empty) (*payload.Info_Index_Detail, error) mustEmbedUnimplementedIndexServer() } @@ -76,9 +93,16 @@ type IndexServer interface { type UnimplementedIndexServer struct { } -func (UnimplementedIndexServer) IndexInfo(context.Context, *payload.Empty) (*payload.Info_Index_Count, error) { +func (UnimplementedIndexServer) IndexInfo( + context.Context, *payload.Empty, +) (*payload.Info_Index_Count, error) { return nil, status.Errorf(codes.Unimplemented, "method IndexInfo not implemented") } +func (UnimplementedIndexServer) IndexDetail( + context.Context, *payload.Empty, +) (*payload.Info_Index_Detail, error) { + return nil, status.Errorf(codes.Unimplemented, "method IndexDetail not implemented") +} func (UnimplementedIndexServer) mustEmbedUnimplementedIndexServer() {} // UnsafeIndexServer may be embedded to opt out of forward compatibility for this service. @@ -92,7 +116,9 @@ func RegisterIndexServer(s grpc.ServiceRegistrar, srv IndexServer) { s.RegisterService(&Index_ServiceDesc, srv) } -func _Index_IndexInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Index_IndexInfo_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Empty) if err := dec(in); err != nil { return nil, err @@ -102,26 +128,50 @@ func _Index_IndexInfo_Handler(srv interface{}, ctx context.Context, dec func(int } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/manager.index.v1.Index/IndexInfo", + FullMethod: "/vald.v1.Index/IndexInfo", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(IndexServer).IndexInfo(ctx, req.(*payload.Empty)) } return interceptor(ctx, in, info, handler) } +func _Index_IndexDetail_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { + in := new(payload.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IndexServer).IndexDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vald.v1.Index/IndexDetail", + } + handler := func(ctx context.Context, req any) (any, error) { + return srv.(IndexServer).IndexDetail(ctx, req.(*payload.Empty)) + } + return interceptor(ctx, in, info, handler) +} + // Index_ServiceDesc is the grpc.ServiceDesc for Index service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var Index_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "manager.index.v1.Index", + ServiceName: "vald.v1.Index", HandlerType: (*IndexServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "IndexInfo", Handler: _Index_IndexInfo_Handler, }, + { + MethodName: "IndexDetail", + Handler: _Index_IndexDetail_Handler, + }, }, Streams: []grpc.StreamDesc{}, - Metadata: "v1/manager/index/index_manager.proto", + Metadata: "v1/vald/index.proto", } diff --git a/apis/grpc/v1/vald/insert.pb.go b/apis/grpc/v1/vald/insert.pb.go index 8a5f6997f6d..329618f243a 100644 --- a/apis/grpc/v1/vald/insert.pb.go +++ b/apis/grpc/v1/vald/insert.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 +// protoc-gen-go v1.34.2 // protoc (unknown) // source: v1/vald/insert.proto @@ -73,7 +73,7 @@ var file_v1_vald_insert_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -var file_v1_vald_insert_proto_goTypes = []interface{}{ +var file_v1_vald_insert_proto_goTypes = []any{ (*payload.Insert_Request)(nil), // 0: payload.v1.Insert.Request (*payload.Insert_MultiRequest)(nil), // 1: payload.v1.Insert.MultiRequest (*payload.Object_Location)(nil), // 2: payload.v1.Object.Location diff --git a/apis/grpc/v1/vald/insert_vtproto.pb.go b/apis/grpc/v1/vald/insert_vtproto.pb.go index e24279f226a..4274c79f0a7 100644 --- a/apis/grpc/v1/vald/insert_vtproto.pb.go +++ b/apis/grpc/v1/vald/insert_vtproto.pb.go @@ -58,7 +58,9 @@ func NewInsertClient(cc grpc.ClientConnInterface) InsertClient { return &insertClient{cc} } -func (c *insertClient) Insert(ctx context.Context, in *payload.Insert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { +func (c *insertClient) Insert( + ctx context.Context, in *payload.Insert_Request, opts ...grpc.CallOption, +) (*payload.Object_Location, error) { out := new(payload.Object_Location) err := c.cc.Invoke(ctx, "/vald.v1.Insert/Insert", in, out, opts...) if err != nil { @@ -67,7 +69,9 @@ func (c *insertClient) Insert(ctx context.Context, in *payload.Insert_Request, o return out, nil } -func (c *insertClient) StreamInsert(ctx context.Context, opts ...grpc.CallOption) (Insert_StreamInsertClient, error) { +func (c *insertClient) StreamInsert( + ctx context.Context, opts ...grpc.CallOption, +) (Insert_StreamInsertClient, error) { stream, err := c.cc.NewStream(ctx, &Insert_ServiceDesc.Streams[0], "/vald.v1.Insert/StreamInsert", opts...) if err != nil { return nil, err @@ -98,7 +102,9 @@ func (x *insertStreamInsertClient) Recv() (*payload.Object_StreamLocation, error return m, nil } -func (c *insertClient) MultiInsert(ctx context.Context, in *payload.Insert_MultiRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) { +func (c *insertClient) MultiInsert( + ctx context.Context, in *payload.Insert_MultiRequest, opts ...grpc.CallOption, +) (*payload.Object_Locations, error) { out := new(payload.Object_Locations) err := c.cc.Invoke(ctx, "/vald.v1.Insert/MultiInsert", in, out, opts...) if err != nil { @@ -124,13 +130,17 @@ type InsertServer interface { type UnimplementedInsertServer struct { } -func (UnimplementedInsertServer) Insert(context.Context, *payload.Insert_Request) (*payload.Object_Location, error) { +func (UnimplementedInsertServer) Insert( + context.Context, *payload.Insert_Request, +) (*payload.Object_Location, error) { return nil, status.Errorf(codes.Unimplemented, "method Insert not implemented") } func (UnimplementedInsertServer) StreamInsert(Insert_StreamInsertServer) error { return status.Errorf(codes.Unimplemented, "method StreamInsert not implemented") } -func (UnimplementedInsertServer) MultiInsert(context.Context, *payload.Insert_MultiRequest) (*payload.Object_Locations, error) { +func (UnimplementedInsertServer) MultiInsert( + context.Context, *payload.Insert_MultiRequest, +) (*payload.Object_Locations, error) { return nil, status.Errorf(codes.Unimplemented, "method MultiInsert not implemented") } func (UnimplementedInsertServer) mustEmbedUnimplementedInsertServer() {} @@ -146,7 +156,9 @@ func RegisterInsertServer(s grpc.ServiceRegistrar, srv InsertServer) { s.RegisterService(&Insert_ServiceDesc, srv) } -func _Insert_Insert_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Insert_Insert_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Insert_Request) if err := dec(in); err != nil { return nil, err @@ -158,13 +170,13 @@ func _Insert_Insert_Handler(srv interface{}, ctx context.Context, dec func(inter Server: srv, FullMethod: "/vald.v1.Insert/Insert", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(InsertServer).Insert(ctx, req.(*payload.Insert_Request)) } return interceptor(ctx, in, info, handler) } -func _Insert_StreamInsert_Handler(srv interface{}, stream grpc.ServerStream) error { +func _Insert_StreamInsert_Handler(srv any, stream grpc.ServerStream) error { return srv.(InsertServer).StreamInsert(&insertStreamInsertServer{stream}) } @@ -190,7 +202,9 @@ func (x *insertStreamInsertServer) Recv() (*payload.Insert_Request, error) { return m, nil } -func _Insert_MultiInsert_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Insert_MultiInsert_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Insert_MultiRequest) if err := dec(in); err != nil { return nil, err @@ -202,7 +216,7 @@ func _Insert_MultiInsert_Handler(srv interface{}, ctx context.Context, dec func( Server: srv, FullMethod: "/vald.v1.Insert/MultiInsert", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(InsertServer).MultiInsert(ctx, req.(*payload.Insert_MultiRequest)) } return interceptor(ctx, in, info, handler) diff --git a/apis/grpc/v1/vald/object.pb.go b/apis/grpc/v1/vald/object.pb.go index 9730bfff6ab..3ccfeea9f52 100644 --- a/apis/grpc/v1/vald/object.pb.go +++ b/apis/grpc/v1/vald/object.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 +// protoc-gen-go v1.34.2 // protoc (unknown) // source: v1/vald/object.proto @@ -46,7 +46,7 @@ var file_v1_vald_object_proto_rawDesc = []byte{ 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x84, 0x03, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, + 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xf5, 0x03, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x4c, 0x0a, 0x06, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x15, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x49, 0x44, 0x1a, 0x15, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, @@ -70,34 +70,45 @@ var file_v1_vald_object_proto_rawDesc = []byte{ 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x12, 0x0c, - 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x30, 0x01, 0x42, 0x53, - 0x0a, 0x1a, 0x6f, 0x72, 0x67, 0x2e, 0x76, 0x64, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x61, 0x6c, 0x64, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x76, 0x61, 0x6c, 0x64, 0x42, 0x0a, 0x56, 0x61, - 0x6c, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x64, 0x61, 0x61, 0x73, 0x2f, 0x76, 0x61, 0x6c, - 0x64, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x76, - 0x61, 0x6c, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x30, 0x01, 0x12, 0x6f, + 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x23, + 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x69, 0x64, 0x2e, 0x69, 0x64, 0x7d, 0x42, + 0x53, 0x0a, 0x1a, 0x6f, 0x72, 0x67, 0x2e, 0x76, 0x64, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x61, 0x6c, + 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x76, 0x61, 0x6c, 0x64, 0x42, 0x0a, 0x56, + 0x61, 0x6c, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x64, 0x61, 0x61, 0x73, 0x2f, 0x76, 0x61, + 0x6c, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x2f, + 0x76, 0x61, 0x6c, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -var file_v1_vald_object_proto_goTypes = []interface{}{ - (*payload.Object_ID)(nil), // 0: payload.v1.Object.ID - (*payload.Object_VectorRequest)(nil), // 1: payload.v1.Object.VectorRequest - (*payload.Object_List_Request)(nil), // 2: payload.v1.Object.List.Request - (*payload.Object_Vector)(nil), // 3: payload.v1.Object.Vector - (*payload.Object_StreamVector)(nil), // 4: payload.v1.Object.StreamVector - (*payload.Object_List_Response)(nil), // 5: payload.v1.Object.List.Response +var file_v1_vald_object_proto_goTypes = []any{ + (*payload.Object_ID)(nil), // 0: payload.v1.Object.ID + (*payload.Object_VectorRequest)(nil), // 1: payload.v1.Object.VectorRequest + (*payload.Object_List_Request)(nil), // 2: payload.v1.Object.List.Request + (*payload.Object_TimestampRequest)(nil), // 3: payload.v1.Object.TimestampRequest + (*payload.Object_Vector)(nil), // 4: payload.v1.Object.Vector + (*payload.Object_StreamVector)(nil), // 5: payload.v1.Object.StreamVector + (*payload.Object_List_Response)(nil), // 6: payload.v1.Object.List.Response + (*payload.Object_Timestamp)(nil), // 7: payload.v1.Object.Timestamp } var file_v1_vald_object_proto_depIdxs = []int32{ 0, // 0: vald.v1.Object.Exists:input_type -> payload.v1.Object.ID 1, // 1: vald.v1.Object.GetObject:input_type -> payload.v1.Object.VectorRequest 1, // 2: vald.v1.Object.StreamGetObject:input_type -> payload.v1.Object.VectorRequest 2, // 3: vald.v1.Object.StreamListObject:input_type -> payload.v1.Object.List.Request - 0, // 4: vald.v1.Object.Exists:output_type -> payload.v1.Object.ID - 3, // 5: vald.v1.Object.GetObject:output_type -> payload.v1.Object.Vector - 4, // 6: vald.v1.Object.StreamGetObject:output_type -> payload.v1.Object.StreamVector - 5, // 7: vald.v1.Object.StreamListObject:output_type -> payload.v1.Object.List.Response - 4, // [4:8] is the sub-list for method output_type - 0, // [0:4] is the sub-list for method input_type + 3, // 4: vald.v1.Object.GetTimestamp:input_type -> payload.v1.Object.TimestampRequest + 0, // 5: vald.v1.Object.Exists:output_type -> payload.v1.Object.ID + 4, // 6: vald.v1.Object.GetObject:output_type -> payload.v1.Object.Vector + 5, // 7: vald.v1.Object.StreamGetObject:output_type -> payload.v1.Object.StreamVector + 6, // 8: vald.v1.Object.StreamListObject:output_type -> payload.v1.Object.List.Response + 7, // 9: vald.v1.Object.GetTimestamp:output_type -> payload.v1.Object.Timestamp + 5, // [5:10] is the sub-list for method output_type + 0, // [0:5] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name diff --git a/apis/grpc/v1/vald/object_vtproto.pb.go b/apis/grpc/v1/vald/object_vtproto.pb.go index 3f558288299..d3beaa6dcd7 100644 --- a/apis/grpc/v1/vald/object_vtproto.pb.go +++ b/apis/grpc/v1/vald/object_vtproto.pb.go @@ -50,6 +50,8 @@ type ObjectClient interface { StreamGetObject(ctx context.Context, opts ...grpc.CallOption) (Object_StreamGetObjectClient, error) // A method to get all the vectors with server streaming StreamListObject(ctx context.Context, in *payload.Object_List_Request, opts ...grpc.CallOption) (Object_StreamListObjectClient, error) + // Represent the RPC to get the vector metadata. This RPC is mainly used for index correction process + GetTimestamp(ctx context.Context, in *payload.Object_TimestampRequest, opts ...grpc.CallOption) (*payload.Object_Timestamp, error) } type objectClient struct { @@ -60,7 +62,9 @@ func NewObjectClient(cc grpc.ClientConnInterface) ObjectClient { return &objectClient{cc} } -func (c *objectClient) Exists(ctx context.Context, in *payload.Object_ID, opts ...grpc.CallOption) (*payload.Object_ID, error) { +func (c *objectClient) Exists( + ctx context.Context, in *payload.Object_ID, opts ...grpc.CallOption, +) (*payload.Object_ID, error) { out := new(payload.Object_ID) err := c.cc.Invoke(ctx, "/vald.v1.Object/Exists", in, out, opts...) if err != nil { @@ -69,7 +73,9 @@ func (c *objectClient) Exists(ctx context.Context, in *payload.Object_ID, opts . return out, nil } -func (c *objectClient) GetObject(ctx context.Context, in *payload.Object_VectorRequest, opts ...grpc.CallOption) (*payload.Object_Vector, error) { +func (c *objectClient) GetObject( + ctx context.Context, in *payload.Object_VectorRequest, opts ...grpc.CallOption, +) (*payload.Object_Vector, error) { out := new(payload.Object_Vector) err := c.cc.Invoke(ctx, "/vald.v1.Object/GetObject", in, out, opts...) if err != nil { @@ -78,7 +84,9 @@ func (c *objectClient) GetObject(ctx context.Context, in *payload.Object_VectorR return out, nil } -func (c *objectClient) StreamGetObject(ctx context.Context, opts ...grpc.CallOption) (Object_StreamGetObjectClient, error) { +func (c *objectClient) StreamGetObject( + ctx context.Context, opts ...grpc.CallOption, +) (Object_StreamGetObjectClient, error) { stream, err := c.cc.NewStream(ctx, &Object_ServiceDesc.Streams[0], "/vald.v1.Object/StreamGetObject", opts...) if err != nil { return nil, err @@ -109,7 +117,9 @@ func (x *objectStreamGetObjectClient) Recv() (*payload.Object_StreamVector, erro return m, nil } -func (c *objectClient) StreamListObject(ctx context.Context, in *payload.Object_List_Request, opts ...grpc.CallOption) (Object_StreamListObjectClient, error) { +func (c *objectClient) StreamListObject( + ctx context.Context, in *payload.Object_List_Request, opts ...grpc.CallOption, +) (Object_StreamListObjectClient, error) { stream, err := c.cc.NewStream(ctx, &Object_ServiceDesc.Streams[1], "/vald.v1.Object/StreamListObject", opts...) if err != nil { return nil, err @@ -141,6 +151,17 @@ func (x *objectStreamListObjectClient) Recv() (*payload.Object_List_Response, er return m, nil } +func (c *objectClient) GetTimestamp( + ctx context.Context, in *payload.Object_TimestampRequest, opts ...grpc.CallOption, +) (*payload.Object_Timestamp, error) { + out := new(payload.Object_Timestamp) + err := c.cc.Invoke(ctx, "/vald.v1.Object/GetTimestamp", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ObjectServer is the server API for Object service. // All implementations must embed UnimplementedObjectServer // for forward compatibility @@ -153,6 +174,8 @@ type ObjectServer interface { StreamGetObject(Object_StreamGetObjectServer) error // A method to get all the vectors with server streaming StreamListObject(*payload.Object_List_Request, Object_StreamListObjectServer) error + // Represent the RPC to get the vector metadata. This RPC is mainly used for index correction process + GetTimestamp(context.Context, *payload.Object_TimestampRequest) (*payload.Object_Timestamp, error) mustEmbedUnimplementedObjectServer() } @@ -160,18 +183,29 @@ type ObjectServer interface { type UnimplementedObjectServer struct { } -func (UnimplementedObjectServer) Exists(context.Context, *payload.Object_ID) (*payload.Object_ID, error) { +func (UnimplementedObjectServer) Exists( + context.Context, *payload.Object_ID, +) (*payload.Object_ID, error) { return nil, status.Errorf(codes.Unimplemented, "method Exists not implemented") } -func (UnimplementedObjectServer) GetObject(context.Context, *payload.Object_VectorRequest) (*payload.Object_Vector, error) { +func (UnimplementedObjectServer) GetObject( + context.Context, *payload.Object_VectorRequest, +) (*payload.Object_Vector, error) { return nil, status.Errorf(codes.Unimplemented, "method GetObject not implemented") } func (UnimplementedObjectServer) StreamGetObject(Object_StreamGetObjectServer) error { return status.Errorf(codes.Unimplemented, "method StreamGetObject not implemented") } -func (UnimplementedObjectServer) StreamListObject(*payload.Object_List_Request, Object_StreamListObjectServer) error { +func (UnimplementedObjectServer) StreamListObject( + *payload.Object_List_Request, Object_StreamListObjectServer, +) error { return status.Errorf(codes.Unimplemented, "method StreamListObject not implemented") } +func (UnimplementedObjectServer) GetTimestamp( + context.Context, *payload.Object_TimestampRequest, +) (*payload.Object_Timestamp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetTimestamp not implemented") +} func (UnimplementedObjectServer) mustEmbedUnimplementedObjectServer() {} // UnsafeObjectServer may be embedded to opt out of forward compatibility for this service. @@ -185,7 +219,9 @@ func RegisterObjectServer(s grpc.ServiceRegistrar, srv ObjectServer) { s.RegisterService(&Object_ServiceDesc, srv) } -func _Object_Exists_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Object_Exists_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Object_ID) if err := dec(in); err != nil { return nil, err @@ -197,13 +233,15 @@ func _Object_Exists_Handler(srv interface{}, ctx context.Context, dec func(inter Server: srv, FullMethod: "/vald.v1.Object/Exists", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(ObjectServer).Exists(ctx, req.(*payload.Object_ID)) } return interceptor(ctx, in, info, handler) } -func _Object_GetObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Object_GetObject_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Object_VectorRequest) if err := dec(in); err != nil { return nil, err @@ -215,13 +253,13 @@ func _Object_GetObject_Handler(srv interface{}, ctx context.Context, dec func(in Server: srv, FullMethod: "/vald.v1.Object/GetObject", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(ObjectServer).GetObject(ctx, req.(*payload.Object_VectorRequest)) } return interceptor(ctx, in, info, handler) } -func _Object_StreamGetObject_Handler(srv interface{}, stream grpc.ServerStream) error { +func _Object_StreamGetObject_Handler(srv any, stream grpc.ServerStream) error { return srv.(ObjectServer).StreamGetObject(&objectStreamGetObjectServer{stream}) } @@ -247,7 +285,7 @@ func (x *objectStreamGetObjectServer) Recv() (*payload.Object_VectorRequest, err return m, nil } -func _Object_StreamListObject_Handler(srv interface{}, stream grpc.ServerStream) error { +func _Object_StreamListObject_Handler(srv any, stream grpc.ServerStream) error { m := new(payload.Object_List_Request) if err := stream.RecvMsg(m); err != nil { return err @@ -268,6 +306,26 @@ func (x *objectStreamListObjectServer) Send(m *payload.Object_List_Response) err return x.ServerStream.SendMsg(m) } +func _Object_GetTimestamp_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { + in := new(payload.Object_TimestampRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ObjectServer).GetTimestamp(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vald.v1.Object/GetTimestamp", + } + handler := func(ctx context.Context, req any) (any, error) { + return srv.(ObjectServer).GetTimestamp(ctx, req.(*payload.Object_TimestampRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Object_ServiceDesc is the grpc.ServiceDesc for Object service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -283,6 +341,10 @@ var Object_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetObject", Handler: _Object_GetObject_Handler, }, + { + MethodName: "GetTimestamp", + Handler: _Object_GetTimestamp_Handler, + }, }, Streams: []grpc.StreamDesc{ { diff --git a/apis/grpc/v1/vald/remove.pb.go b/apis/grpc/v1/vald/remove.pb.go index 1e16f2f3b88..bbb48c7b84a 100644 --- a/apis/grpc/v1/vald/remove.pb.go +++ b/apis/grpc/v1/vald/remove.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 +// protoc-gen-go v1.34.2 // protoc (unknown) // source: v1/vald/remove.proto @@ -80,7 +80,7 @@ var file_v1_vald_remove_proto_rawDesc = []byte{ 0x76, 0x61, 0x6c, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -var file_v1_vald_remove_proto_goTypes = []interface{}{ +var file_v1_vald_remove_proto_goTypes = []any{ (*payload.Remove_Request)(nil), // 0: payload.v1.Remove.Request (*payload.Remove_TimestampRequest)(nil), // 1: payload.v1.Remove.TimestampRequest (*payload.Remove_MultiRequest)(nil), // 2: payload.v1.Remove.MultiRequest diff --git a/apis/grpc/v1/vald/remove_vtproto.pb.go b/apis/grpc/v1/vald/remove_vtproto.pb.go index 8355ebab103..7a41f97a34e 100644 --- a/apis/grpc/v1/vald/remove_vtproto.pb.go +++ b/apis/grpc/v1/vald/remove_vtproto.pb.go @@ -60,7 +60,9 @@ func NewRemoveClient(cc grpc.ClientConnInterface) RemoveClient { return &removeClient{cc} } -func (c *removeClient) Remove(ctx context.Context, in *payload.Remove_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { +func (c *removeClient) Remove( + ctx context.Context, in *payload.Remove_Request, opts ...grpc.CallOption, +) (*payload.Object_Location, error) { out := new(payload.Object_Location) err := c.cc.Invoke(ctx, "/vald.v1.Remove/Remove", in, out, opts...) if err != nil { @@ -69,7 +71,9 @@ func (c *removeClient) Remove(ctx context.Context, in *payload.Remove_Request, o return out, nil } -func (c *removeClient) RemoveByTimestamp(ctx context.Context, in *payload.Remove_TimestampRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) { +func (c *removeClient) RemoveByTimestamp( + ctx context.Context, in *payload.Remove_TimestampRequest, opts ...grpc.CallOption, +) (*payload.Object_Locations, error) { out := new(payload.Object_Locations) err := c.cc.Invoke(ctx, "/vald.v1.Remove/RemoveByTimestamp", in, out, opts...) if err != nil { @@ -78,7 +82,9 @@ func (c *removeClient) RemoveByTimestamp(ctx context.Context, in *payload.Remove return out, nil } -func (c *removeClient) StreamRemove(ctx context.Context, opts ...grpc.CallOption) (Remove_StreamRemoveClient, error) { +func (c *removeClient) StreamRemove( + ctx context.Context, opts ...grpc.CallOption, +) (Remove_StreamRemoveClient, error) { stream, err := c.cc.NewStream(ctx, &Remove_ServiceDesc.Streams[0], "/vald.v1.Remove/StreamRemove", opts...) if err != nil { return nil, err @@ -109,7 +115,9 @@ func (x *removeStreamRemoveClient) Recv() (*payload.Object_StreamLocation, error return m, nil } -func (c *removeClient) MultiRemove(ctx context.Context, in *payload.Remove_MultiRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) { +func (c *removeClient) MultiRemove( + ctx context.Context, in *payload.Remove_MultiRequest, opts ...grpc.CallOption, +) (*payload.Object_Locations, error) { out := new(payload.Object_Locations) err := c.cc.Invoke(ctx, "/vald.v1.Remove/MultiRemove", in, out, opts...) if err != nil { @@ -137,16 +145,22 @@ type RemoveServer interface { type UnimplementedRemoveServer struct { } -func (UnimplementedRemoveServer) Remove(context.Context, *payload.Remove_Request) (*payload.Object_Location, error) { +func (UnimplementedRemoveServer) Remove( + context.Context, *payload.Remove_Request, +) (*payload.Object_Location, error) { return nil, status.Errorf(codes.Unimplemented, "method Remove not implemented") } -func (UnimplementedRemoveServer) RemoveByTimestamp(context.Context, *payload.Remove_TimestampRequest) (*payload.Object_Locations, error) { +func (UnimplementedRemoveServer) RemoveByTimestamp( + context.Context, *payload.Remove_TimestampRequest, +) (*payload.Object_Locations, error) { return nil, status.Errorf(codes.Unimplemented, "method RemoveByTimestamp not implemented") } func (UnimplementedRemoveServer) StreamRemove(Remove_StreamRemoveServer) error { return status.Errorf(codes.Unimplemented, "method StreamRemove not implemented") } -func (UnimplementedRemoveServer) MultiRemove(context.Context, *payload.Remove_MultiRequest) (*payload.Object_Locations, error) { +func (UnimplementedRemoveServer) MultiRemove( + context.Context, *payload.Remove_MultiRequest, +) (*payload.Object_Locations, error) { return nil, status.Errorf(codes.Unimplemented, "method MultiRemove not implemented") } func (UnimplementedRemoveServer) mustEmbedUnimplementedRemoveServer() {} @@ -162,7 +176,9 @@ func RegisterRemoveServer(s grpc.ServiceRegistrar, srv RemoveServer) { s.RegisterService(&Remove_ServiceDesc, srv) } -func _Remove_Remove_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Remove_Remove_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Remove_Request) if err := dec(in); err != nil { return nil, err @@ -174,13 +190,15 @@ func _Remove_Remove_Handler(srv interface{}, ctx context.Context, dec func(inter Server: srv, FullMethod: "/vald.v1.Remove/Remove", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(RemoveServer).Remove(ctx, req.(*payload.Remove_Request)) } return interceptor(ctx, in, info, handler) } -func _Remove_RemoveByTimestamp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Remove_RemoveByTimestamp_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Remove_TimestampRequest) if err := dec(in); err != nil { return nil, err @@ -192,13 +210,13 @@ func _Remove_RemoveByTimestamp_Handler(srv interface{}, ctx context.Context, dec Server: srv, FullMethod: "/vald.v1.Remove/RemoveByTimestamp", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(RemoveServer).RemoveByTimestamp(ctx, req.(*payload.Remove_TimestampRequest)) } return interceptor(ctx, in, info, handler) } -func _Remove_StreamRemove_Handler(srv interface{}, stream grpc.ServerStream) error { +func _Remove_StreamRemove_Handler(srv any, stream grpc.ServerStream) error { return srv.(RemoveServer).StreamRemove(&removeStreamRemoveServer{stream}) } @@ -224,7 +242,9 @@ func (x *removeStreamRemoveServer) Recv() (*payload.Remove_Request, error) { return m, nil } -func _Remove_MultiRemove_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Remove_MultiRemove_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Remove_MultiRequest) if err := dec(in); err != nil { return nil, err @@ -236,7 +256,7 @@ func _Remove_MultiRemove_Handler(srv interface{}, ctx context.Context, dec func( Server: srv, FullMethod: "/vald.v1.Remove/MultiRemove", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(RemoveServer).MultiRemove(ctx, req.(*payload.Remove_MultiRequest)) } return interceptor(ctx, in, info, handler) diff --git a/apis/grpc/v1/vald/search.pb.go b/apis/grpc/v1/vald/search.pb.go index 960c0b50815..6d930bd2db0 100644 --- a/apis/grpc/v1/vald/search.pb.go +++ b/apis/grpc/v1/vald/search.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 +// protoc-gen-go v1.34.2 // protoc (unknown) // source: v1/vald/search.proto @@ -132,7 +132,7 @@ var file_v1_vald_search_proto_rawDesc = []byte{ 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -var file_v1_vald_search_proto_goTypes = []interface{}{ +var file_v1_vald_search_proto_goTypes = []any{ (*payload.Search_Request)(nil), // 0: payload.v1.Search.Request (*payload.Search_IDRequest)(nil), // 1: payload.v1.Search.IDRequest (*payload.Search_MultiRequest)(nil), // 2: payload.v1.Search.MultiRequest diff --git a/apis/grpc/v1/vald/search_vtproto.pb.go b/apis/grpc/v1/vald/search_vtproto.pb.go index c75cd0b1369..d161a299bcc 100644 --- a/apis/grpc/v1/vald/search_vtproto.pb.go +++ b/apis/grpc/v1/vald/search_vtproto.pb.go @@ -78,7 +78,9 @@ func NewSearchClient(cc grpc.ClientConnInterface) SearchClient { return &searchClient{cc} } -func (c *searchClient) Search(ctx context.Context, in *payload.Search_Request, opts ...grpc.CallOption) (*payload.Search_Response, error) { +func (c *searchClient) Search( + ctx context.Context, in *payload.Search_Request, opts ...grpc.CallOption, +) (*payload.Search_Response, error) { out := new(payload.Search_Response) err := c.cc.Invoke(ctx, "/vald.v1.Search/Search", in, out, opts...) if err != nil { @@ -87,7 +89,9 @@ func (c *searchClient) Search(ctx context.Context, in *payload.Search_Request, o return out, nil } -func (c *searchClient) SearchByID(ctx context.Context, in *payload.Search_IDRequest, opts ...grpc.CallOption) (*payload.Search_Response, error) { +func (c *searchClient) SearchByID( + ctx context.Context, in *payload.Search_IDRequest, opts ...grpc.CallOption, +) (*payload.Search_Response, error) { out := new(payload.Search_Response) err := c.cc.Invoke(ctx, "/vald.v1.Search/SearchByID", in, out, opts...) if err != nil { @@ -96,7 +100,9 @@ func (c *searchClient) SearchByID(ctx context.Context, in *payload.Search_IDRequ return out, nil } -func (c *searchClient) StreamSearch(ctx context.Context, opts ...grpc.CallOption) (Search_StreamSearchClient, error) { +func (c *searchClient) StreamSearch( + ctx context.Context, opts ...grpc.CallOption, +) (Search_StreamSearchClient, error) { stream, err := c.cc.NewStream(ctx, &Search_ServiceDesc.Streams[0], "/vald.v1.Search/StreamSearch", opts...) if err != nil { return nil, err @@ -127,7 +133,9 @@ func (x *searchStreamSearchClient) Recv() (*payload.Search_StreamResponse, error return m, nil } -func (c *searchClient) StreamSearchByID(ctx context.Context, opts ...grpc.CallOption) (Search_StreamSearchByIDClient, error) { +func (c *searchClient) StreamSearchByID( + ctx context.Context, opts ...grpc.CallOption, +) (Search_StreamSearchByIDClient, error) { stream, err := c.cc.NewStream(ctx, &Search_ServiceDesc.Streams[1], "/vald.v1.Search/StreamSearchByID", opts...) if err != nil { return nil, err @@ -158,7 +166,9 @@ func (x *searchStreamSearchByIDClient) Recv() (*payload.Search_StreamResponse, e return m, nil } -func (c *searchClient) MultiSearch(ctx context.Context, in *payload.Search_MultiRequest, opts ...grpc.CallOption) (*payload.Search_Responses, error) { +func (c *searchClient) MultiSearch( + ctx context.Context, in *payload.Search_MultiRequest, opts ...grpc.CallOption, +) (*payload.Search_Responses, error) { out := new(payload.Search_Responses) err := c.cc.Invoke(ctx, "/vald.v1.Search/MultiSearch", in, out, opts...) if err != nil { @@ -167,7 +177,9 @@ func (c *searchClient) MultiSearch(ctx context.Context, in *payload.Search_Multi return out, nil } -func (c *searchClient) MultiSearchByID(ctx context.Context, in *payload.Search_MultiIDRequest, opts ...grpc.CallOption) (*payload.Search_Responses, error) { +func (c *searchClient) MultiSearchByID( + ctx context.Context, in *payload.Search_MultiIDRequest, opts ...grpc.CallOption, +) (*payload.Search_Responses, error) { out := new(payload.Search_Responses) err := c.cc.Invoke(ctx, "/vald.v1.Search/MultiSearchByID", in, out, opts...) if err != nil { @@ -176,7 +188,9 @@ func (c *searchClient) MultiSearchByID(ctx context.Context, in *payload.Search_M return out, nil } -func (c *searchClient) LinearSearch(ctx context.Context, in *payload.Search_Request, opts ...grpc.CallOption) (*payload.Search_Response, error) { +func (c *searchClient) LinearSearch( + ctx context.Context, in *payload.Search_Request, opts ...grpc.CallOption, +) (*payload.Search_Response, error) { out := new(payload.Search_Response) err := c.cc.Invoke(ctx, "/vald.v1.Search/LinearSearch", in, out, opts...) if err != nil { @@ -185,7 +199,9 @@ func (c *searchClient) LinearSearch(ctx context.Context, in *payload.Search_Requ return out, nil } -func (c *searchClient) LinearSearchByID(ctx context.Context, in *payload.Search_IDRequest, opts ...grpc.CallOption) (*payload.Search_Response, error) { +func (c *searchClient) LinearSearchByID( + ctx context.Context, in *payload.Search_IDRequest, opts ...grpc.CallOption, +) (*payload.Search_Response, error) { out := new(payload.Search_Response) err := c.cc.Invoke(ctx, "/vald.v1.Search/LinearSearchByID", in, out, opts...) if err != nil { @@ -194,7 +210,9 @@ func (c *searchClient) LinearSearchByID(ctx context.Context, in *payload.Search_ return out, nil } -func (c *searchClient) StreamLinearSearch(ctx context.Context, opts ...grpc.CallOption) (Search_StreamLinearSearchClient, error) { +func (c *searchClient) StreamLinearSearch( + ctx context.Context, opts ...grpc.CallOption, +) (Search_StreamLinearSearchClient, error) { stream, err := c.cc.NewStream(ctx, &Search_ServiceDesc.Streams[2], "/vald.v1.Search/StreamLinearSearch", opts...) if err != nil { return nil, err @@ -225,7 +243,9 @@ func (x *searchStreamLinearSearchClient) Recv() (*payload.Search_StreamResponse, return m, nil } -func (c *searchClient) StreamLinearSearchByID(ctx context.Context, opts ...grpc.CallOption) (Search_StreamLinearSearchByIDClient, error) { +func (c *searchClient) StreamLinearSearchByID( + ctx context.Context, opts ...grpc.CallOption, +) (Search_StreamLinearSearchByIDClient, error) { stream, err := c.cc.NewStream(ctx, &Search_ServiceDesc.Streams[3], "/vald.v1.Search/StreamLinearSearchByID", opts...) if err != nil { return nil, err @@ -256,7 +276,9 @@ func (x *searchStreamLinearSearchByIDClient) Recv() (*payload.Search_StreamRespo return m, nil } -func (c *searchClient) MultiLinearSearch(ctx context.Context, in *payload.Search_MultiRequest, opts ...grpc.CallOption) (*payload.Search_Responses, error) { +func (c *searchClient) MultiLinearSearch( + ctx context.Context, in *payload.Search_MultiRequest, opts ...grpc.CallOption, +) (*payload.Search_Responses, error) { out := new(payload.Search_Responses) err := c.cc.Invoke(ctx, "/vald.v1.Search/MultiLinearSearch", in, out, opts...) if err != nil { @@ -265,7 +287,9 @@ func (c *searchClient) MultiLinearSearch(ctx context.Context, in *payload.Search return out, nil } -func (c *searchClient) MultiLinearSearchByID(ctx context.Context, in *payload.Search_MultiIDRequest, opts ...grpc.CallOption) (*payload.Search_Responses, error) { +func (c *searchClient) MultiLinearSearchByID( + ctx context.Context, in *payload.Search_MultiIDRequest, opts ...grpc.CallOption, +) (*payload.Search_Responses, error) { out := new(payload.Search_Responses) err := c.cc.Invoke(ctx, "/vald.v1.Search/MultiLinearSearchByID", in, out, opts...) if err != nil { @@ -311,10 +335,14 @@ type SearchServer interface { type UnimplementedSearchServer struct { } -func (UnimplementedSearchServer) Search(context.Context, *payload.Search_Request) (*payload.Search_Response, error) { +func (UnimplementedSearchServer) Search( + context.Context, *payload.Search_Request, +) (*payload.Search_Response, error) { return nil, status.Errorf(codes.Unimplemented, "method Search not implemented") } -func (UnimplementedSearchServer) SearchByID(context.Context, *payload.Search_IDRequest) (*payload.Search_Response, error) { +func (UnimplementedSearchServer) SearchByID( + context.Context, *payload.Search_IDRequest, +) (*payload.Search_Response, error) { return nil, status.Errorf(codes.Unimplemented, "method SearchByID not implemented") } func (UnimplementedSearchServer) StreamSearch(Search_StreamSearchServer) error { @@ -323,16 +351,24 @@ func (UnimplementedSearchServer) StreamSearch(Search_StreamSearchServer) error { func (UnimplementedSearchServer) StreamSearchByID(Search_StreamSearchByIDServer) error { return status.Errorf(codes.Unimplemented, "method StreamSearchByID not implemented") } -func (UnimplementedSearchServer) MultiSearch(context.Context, *payload.Search_MultiRequest) (*payload.Search_Responses, error) { +func (UnimplementedSearchServer) MultiSearch( + context.Context, *payload.Search_MultiRequest, +) (*payload.Search_Responses, error) { return nil, status.Errorf(codes.Unimplemented, "method MultiSearch not implemented") } -func (UnimplementedSearchServer) MultiSearchByID(context.Context, *payload.Search_MultiIDRequest) (*payload.Search_Responses, error) { +func (UnimplementedSearchServer) MultiSearchByID( + context.Context, *payload.Search_MultiIDRequest, +) (*payload.Search_Responses, error) { return nil, status.Errorf(codes.Unimplemented, "method MultiSearchByID not implemented") } -func (UnimplementedSearchServer) LinearSearch(context.Context, *payload.Search_Request) (*payload.Search_Response, error) { +func (UnimplementedSearchServer) LinearSearch( + context.Context, *payload.Search_Request, +) (*payload.Search_Response, error) { return nil, status.Errorf(codes.Unimplemented, "method LinearSearch not implemented") } -func (UnimplementedSearchServer) LinearSearchByID(context.Context, *payload.Search_IDRequest) (*payload.Search_Response, error) { +func (UnimplementedSearchServer) LinearSearchByID( + context.Context, *payload.Search_IDRequest, +) (*payload.Search_Response, error) { return nil, status.Errorf(codes.Unimplemented, "method LinearSearchByID not implemented") } func (UnimplementedSearchServer) StreamLinearSearch(Search_StreamLinearSearchServer) error { @@ -341,10 +377,14 @@ func (UnimplementedSearchServer) StreamLinearSearch(Search_StreamLinearSearchSer func (UnimplementedSearchServer) StreamLinearSearchByID(Search_StreamLinearSearchByIDServer) error { return status.Errorf(codes.Unimplemented, "method StreamLinearSearchByID not implemented") } -func (UnimplementedSearchServer) MultiLinearSearch(context.Context, *payload.Search_MultiRequest) (*payload.Search_Responses, error) { +func (UnimplementedSearchServer) MultiLinearSearch( + context.Context, *payload.Search_MultiRequest, +) (*payload.Search_Responses, error) { return nil, status.Errorf(codes.Unimplemented, "method MultiLinearSearch not implemented") } -func (UnimplementedSearchServer) MultiLinearSearchByID(context.Context, *payload.Search_MultiIDRequest) (*payload.Search_Responses, error) { +func (UnimplementedSearchServer) MultiLinearSearchByID( + context.Context, *payload.Search_MultiIDRequest, +) (*payload.Search_Responses, error) { return nil, status.Errorf(codes.Unimplemented, "method MultiLinearSearchByID not implemented") } func (UnimplementedSearchServer) mustEmbedUnimplementedSearchServer() {} @@ -360,7 +400,9 @@ func RegisterSearchServer(s grpc.ServiceRegistrar, srv SearchServer) { s.RegisterService(&Search_ServiceDesc, srv) } -func _Search_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Search_Search_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Search_Request) if err := dec(in); err != nil { return nil, err @@ -372,13 +414,15 @@ func _Search_Search_Handler(srv interface{}, ctx context.Context, dec func(inter Server: srv, FullMethod: "/vald.v1.Search/Search", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(SearchServer).Search(ctx, req.(*payload.Search_Request)) } return interceptor(ctx, in, info, handler) } -func _Search_SearchByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Search_SearchByID_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Search_IDRequest) if err := dec(in); err != nil { return nil, err @@ -390,13 +434,13 @@ func _Search_SearchByID_Handler(srv interface{}, ctx context.Context, dec func(i Server: srv, FullMethod: "/vald.v1.Search/SearchByID", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(SearchServer).SearchByID(ctx, req.(*payload.Search_IDRequest)) } return interceptor(ctx, in, info, handler) } -func _Search_StreamSearch_Handler(srv interface{}, stream grpc.ServerStream) error { +func _Search_StreamSearch_Handler(srv any, stream grpc.ServerStream) error { return srv.(SearchServer).StreamSearch(&searchStreamSearchServer{stream}) } @@ -422,7 +466,7 @@ func (x *searchStreamSearchServer) Recv() (*payload.Search_Request, error) { return m, nil } -func _Search_StreamSearchByID_Handler(srv interface{}, stream grpc.ServerStream) error { +func _Search_StreamSearchByID_Handler(srv any, stream grpc.ServerStream) error { return srv.(SearchServer).StreamSearchByID(&searchStreamSearchByIDServer{stream}) } @@ -448,7 +492,9 @@ func (x *searchStreamSearchByIDServer) Recv() (*payload.Search_IDRequest, error) return m, nil } -func _Search_MultiSearch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Search_MultiSearch_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Search_MultiRequest) if err := dec(in); err != nil { return nil, err @@ -460,13 +506,15 @@ func _Search_MultiSearch_Handler(srv interface{}, ctx context.Context, dec func( Server: srv, FullMethod: "/vald.v1.Search/MultiSearch", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(SearchServer).MultiSearch(ctx, req.(*payload.Search_MultiRequest)) } return interceptor(ctx, in, info, handler) } -func _Search_MultiSearchByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Search_MultiSearchByID_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Search_MultiIDRequest) if err := dec(in); err != nil { return nil, err @@ -478,13 +526,15 @@ func _Search_MultiSearchByID_Handler(srv interface{}, ctx context.Context, dec f Server: srv, FullMethod: "/vald.v1.Search/MultiSearchByID", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(SearchServer).MultiSearchByID(ctx, req.(*payload.Search_MultiIDRequest)) } return interceptor(ctx, in, info, handler) } -func _Search_LinearSearch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Search_LinearSearch_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Search_Request) if err := dec(in); err != nil { return nil, err @@ -496,13 +546,15 @@ func _Search_LinearSearch_Handler(srv interface{}, ctx context.Context, dec func Server: srv, FullMethod: "/vald.v1.Search/LinearSearch", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(SearchServer).LinearSearch(ctx, req.(*payload.Search_Request)) } return interceptor(ctx, in, info, handler) } -func _Search_LinearSearchByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Search_LinearSearchByID_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Search_IDRequest) if err := dec(in); err != nil { return nil, err @@ -514,13 +566,13 @@ func _Search_LinearSearchByID_Handler(srv interface{}, ctx context.Context, dec Server: srv, FullMethod: "/vald.v1.Search/LinearSearchByID", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(SearchServer).LinearSearchByID(ctx, req.(*payload.Search_IDRequest)) } return interceptor(ctx, in, info, handler) } -func _Search_StreamLinearSearch_Handler(srv interface{}, stream grpc.ServerStream) error { +func _Search_StreamLinearSearch_Handler(srv any, stream grpc.ServerStream) error { return srv.(SearchServer).StreamLinearSearch(&searchStreamLinearSearchServer{stream}) } @@ -546,7 +598,7 @@ func (x *searchStreamLinearSearchServer) Recv() (*payload.Search_Request, error) return m, nil } -func _Search_StreamLinearSearchByID_Handler(srv interface{}, stream grpc.ServerStream) error { +func _Search_StreamLinearSearchByID_Handler(srv any, stream grpc.ServerStream) error { return srv.(SearchServer).StreamLinearSearchByID(&searchStreamLinearSearchByIDServer{stream}) } @@ -572,7 +624,9 @@ func (x *searchStreamLinearSearchByIDServer) Recv() (*payload.Search_IDRequest, return m, nil } -func _Search_MultiLinearSearch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Search_MultiLinearSearch_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Search_MultiRequest) if err := dec(in); err != nil { return nil, err @@ -584,13 +638,15 @@ func _Search_MultiLinearSearch_Handler(srv interface{}, ctx context.Context, dec Server: srv, FullMethod: "/vald.v1.Search/MultiLinearSearch", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(SearchServer).MultiLinearSearch(ctx, req.(*payload.Search_MultiRequest)) } return interceptor(ctx, in, info, handler) } -func _Search_MultiLinearSearchByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Search_MultiLinearSearchByID_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Search_MultiIDRequest) if err := dec(in); err != nil { return nil, err @@ -602,7 +658,7 @@ func _Search_MultiLinearSearchByID_Handler(srv interface{}, ctx context.Context, Server: srv, FullMethod: "/vald.v1.Search/MultiLinearSearchByID", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(SearchServer).MultiLinearSearchByID(ctx, req.(*payload.Search_MultiIDRequest)) } return interceptor(ctx, in, info, handler) diff --git a/apis/grpc/v1/vald/update.pb.go b/apis/grpc/v1/vald/update.pb.go index 5c9fa2ed27d..91e54a214aa 100644 --- a/apis/grpc/v1/vald/update.pb.go +++ b/apis/grpc/v1/vald/update.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 +// protoc-gen-go v1.34.2 // protoc (unknown) // source: v1/vald/update.proto @@ -73,7 +73,7 @@ var file_v1_vald_update_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -var file_v1_vald_update_proto_goTypes = []interface{}{ +var file_v1_vald_update_proto_goTypes = []any{ (*payload.Update_Request)(nil), // 0: payload.v1.Update.Request (*payload.Update_MultiRequest)(nil), // 1: payload.v1.Update.MultiRequest (*payload.Object_Location)(nil), // 2: payload.v1.Object.Location diff --git a/apis/grpc/v1/vald/update_vtproto.pb.go b/apis/grpc/v1/vald/update_vtproto.pb.go index 70796ba018a..d29106eb95c 100644 --- a/apis/grpc/v1/vald/update_vtproto.pb.go +++ b/apis/grpc/v1/vald/update_vtproto.pb.go @@ -58,7 +58,9 @@ func NewUpdateClient(cc grpc.ClientConnInterface) UpdateClient { return &updateClient{cc} } -func (c *updateClient) Update(ctx context.Context, in *payload.Update_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { +func (c *updateClient) Update( + ctx context.Context, in *payload.Update_Request, opts ...grpc.CallOption, +) (*payload.Object_Location, error) { out := new(payload.Object_Location) err := c.cc.Invoke(ctx, "/vald.v1.Update/Update", in, out, opts...) if err != nil { @@ -67,7 +69,9 @@ func (c *updateClient) Update(ctx context.Context, in *payload.Update_Request, o return out, nil } -func (c *updateClient) StreamUpdate(ctx context.Context, opts ...grpc.CallOption) (Update_StreamUpdateClient, error) { +func (c *updateClient) StreamUpdate( + ctx context.Context, opts ...grpc.CallOption, +) (Update_StreamUpdateClient, error) { stream, err := c.cc.NewStream(ctx, &Update_ServiceDesc.Streams[0], "/vald.v1.Update/StreamUpdate", opts...) if err != nil { return nil, err @@ -98,7 +102,9 @@ func (x *updateStreamUpdateClient) Recv() (*payload.Object_StreamLocation, error return m, nil } -func (c *updateClient) MultiUpdate(ctx context.Context, in *payload.Update_MultiRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) { +func (c *updateClient) MultiUpdate( + ctx context.Context, in *payload.Update_MultiRequest, opts ...grpc.CallOption, +) (*payload.Object_Locations, error) { out := new(payload.Object_Locations) err := c.cc.Invoke(ctx, "/vald.v1.Update/MultiUpdate", in, out, opts...) if err != nil { @@ -124,13 +130,17 @@ type UpdateServer interface { type UnimplementedUpdateServer struct { } -func (UnimplementedUpdateServer) Update(context.Context, *payload.Update_Request) (*payload.Object_Location, error) { +func (UnimplementedUpdateServer) Update( + context.Context, *payload.Update_Request, +) (*payload.Object_Location, error) { return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") } func (UnimplementedUpdateServer) StreamUpdate(Update_StreamUpdateServer) error { return status.Errorf(codes.Unimplemented, "method StreamUpdate not implemented") } -func (UnimplementedUpdateServer) MultiUpdate(context.Context, *payload.Update_MultiRequest) (*payload.Object_Locations, error) { +func (UnimplementedUpdateServer) MultiUpdate( + context.Context, *payload.Update_MultiRequest, +) (*payload.Object_Locations, error) { return nil, status.Errorf(codes.Unimplemented, "method MultiUpdate not implemented") } func (UnimplementedUpdateServer) mustEmbedUnimplementedUpdateServer() {} @@ -146,7 +156,9 @@ func RegisterUpdateServer(s grpc.ServiceRegistrar, srv UpdateServer) { s.RegisterService(&Update_ServiceDesc, srv) } -func _Update_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Update_Update_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Update_Request) if err := dec(in); err != nil { return nil, err @@ -158,13 +170,13 @@ func _Update_Update_Handler(srv interface{}, ctx context.Context, dec func(inter Server: srv, FullMethod: "/vald.v1.Update/Update", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(UpdateServer).Update(ctx, req.(*payload.Update_Request)) } return interceptor(ctx, in, info, handler) } -func _Update_StreamUpdate_Handler(srv interface{}, stream grpc.ServerStream) error { +func _Update_StreamUpdate_Handler(srv any, stream grpc.ServerStream) error { return srv.(UpdateServer).StreamUpdate(&updateStreamUpdateServer{stream}) } @@ -190,7 +202,9 @@ func (x *updateStreamUpdateServer) Recv() (*payload.Update_Request, error) { return m, nil } -func _Update_MultiUpdate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Update_MultiUpdate_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Update_MultiRequest) if err := dec(in); err != nil { return nil, err @@ -202,7 +216,7 @@ func _Update_MultiUpdate_Handler(srv interface{}, ctx context.Context, dec func( Server: srv, FullMethod: "/vald.v1.Update/MultiUpdate", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(UpdateServer).MultiUpdate(ctx, req.(*payload.Update_MultiRequest)) } return interceptor(ctx, in, info, handler) diff --git a/apis/grpc/v1/vald/upsert.pb.go b/apis/grpc/v1/vald/upsert.pb.go index 336c393e1bf..124857f1ca7 100644 --- a/apis/grpc/v1/vald/upsert.pb.go +++ b/apis/grpc/v1/vald/upsert.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 +// protoc-gen-go v1.34.2 // protoc (unknown) // source: v1/vald/upsert.proto @@ -73,7 +73,7 @@ var file_v1_vald_upsert_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -var file_v1_vald_upsert_proto_goTypes = []interface{}{ +var file_v1_vald_upsert_proto_goTypes = []any{ (*payload.Upsert_Request)(nil), // 0: payload.v1.Upsert.Request (*payload.Upsert_MultiRequest)(nil), // 1: payload.v1.Upsert.MultiRequest (*payload.Object_Location)(nil), // 2: payload.v1.Object.Location diff --git a/apis/grpc/v1/vald/upsert_vtproto.pb.go b/apis/grpc/v1/vald/upsert_vtproto.pb.go index d50ca4c7838..b5e846f1f39 100644 --- a/apis/grpc/v1/vald/upsert_vtproto.pb.go +++ b/apis/grpc/v1/vald/upsert_vtproto.pb.go @@ -58,7 +58,9 @@ func NewUpsertClient(cc grpc.ClientConnInterface) UpsertClient { return &upsertClient{cc} } -func (c *upsertClient) Upsert(ctx context.Context, in *payload.Upsert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { +func (c *upsertClient) Upsert( + ctx context.Context, in *payload.Upsert_Request, opts ...grpc.CallOption, +) (*payload.Object_Location, error) { out := new(payload.Object_Location) err := c.cc.Invoke(ctx, "/vald.v1.Upsert/Upsert", in, out, opts...) if err != nil { @@ -67,7 +69,9 @@ func (c *upsertClient) Upsert(ctx context.Context, in *payload.Upsert_Request, o return out, nil } -func (c *upsertClient) StreamUpsert(ctx context.Context, opts ...grpc.CallOption) (Upsert_StreamUpsertClient, error) { +func (c *upsertClient) StreamUpsert( + ctx context.Context, opts ...grpc.CallOption, +) (Upsert_StreamUpsertClient, error) { stream, err := c.cc.NewStream(ctx, &Upsert_ServiceDesc.Streams[0], "/vald.v1.Upsert/StreamUpsert", opts...) if err != nil { return nil, err @@ -98,7 +102,9 @@ func (x *upsertStreamUpsertClient) Recv() (*payload.Object_StreamLocation, error return m, nil } -func (c *upsertClient) MultiUpsert(ctx context.Context, in *payload.Upsert_MultiRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) { +func (c *upsertClient) MultiUpsert( + ctx context.Context, in *payload.Upsert_MultiRequest, opts ...grpc.CallOption, +) (*payload.Object_Locations, error) { out := new(payload.Object_Locations) err := c.cc.Invoke(ctx, "/vald.v1.Upsert/MultiUpsert", in, out, opts...) if err != nil { @@ -124,13 +130,17 @@ type UpsertServer interface { type UnimplementedUpsertServer struct { } -func (UnimplementedUpsertServer) Upsert(context.Context, *payload.Upsert_Request) (*payload.Object_Location, error) { +func (UnimplementedUpsertServer) Upsert( + context.Context, *payload.Upsert_Request, +) (*payload.Object_Location, error) { return nil, status.Errorf(codes.Unimplemented, "method Upsert not implemented") } func (UnimplementedUpsertServer) StreamUpsert(Upsert_StreamUpsertServer) error { return status.Errorf(codes.Unimplemented, "method StreamUpsert not implemented") } -func (UnimplementedUpsertServer) MultiUpsert(context.Context, *payload.Upsert_MultiRequest) (*payload.Object_Locations, error) { +func (UnimplementedUpsertServer) MultiUpsert( + context.Context, *payload.Upsert_MultiRequest, +) (*payload.Object_Locations, error) { return nil, status.Errorf(codes.Unimplemented, "method MultiUpsert not implemented") } func (UnimplementedUpsertServer) mustEmbedUnimplementedUpsertServer() {} @@ -146,7 +156,9 @@ func RegisterUpsertServer(s grpc.ServiceRegistrar, srv UpsertServer) { s.RegisterService(&Upsert_ServiceDesc, srv) } -func _Upsert_Upsert_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Upsert_Upsert_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Upsert_Request) if err := dec(in); err != nil { return nil, err @@ -158,13 +170,13 @@ func _Upsert_Upsert_Handler(srv interface{}, ctx context.Context, dec func(inter Server: srv, FullMethod: "/vald.v1.Upsert/Upsert", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(UpsertServer).Upsert(ctx, req.(*payload.Upsert_Request)) } return interceptor(ctx, in, info, handler) } -func _Upsert_StreamUpsert_Handler(srv interface{}, stream grpc.ServerStream) error { +func _Upsert_StreamUpsert_Handler(srv any, stream grpc.ServerStream) error { return srv.(UpsertServer).StreamUpsert(&upsertStreamUpsertServer{stream}) } @@ -190,7 +202,9 @@ func (x *upsertStreamUpsertServer) Recv() (*payload.Upsert_Request, error) { return m, nil } -func _Upsert_MultiUpsert_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Upsert_MultiUpsert_Handler( + srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, +) (any, error) { in := new(payload.Upsert_MultiRequest) if err := dec(in); err != nil { return nil, err @@ -202,7 +216,7 @@ func _Upsert_MultiUpsert_Handler(srv interface{}, ctx context.Context, dec func( Server: srv, FullMethod: "/vald.v1.Upsert/MultiUpsert", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(UpsertServer).MultiUpsert(ctx, req.(*payload.Upsert_MultiRequest)) } return interceptor(ctx, in, info, handler) diff --git a/apis/grpc/v1/vald/vald.go b/apis/grpc/v1/vald/vald.go index e2886b07824..fb5d97dc541 100644 --- a/apis/grpc/v1/vald/vald.go +++ b/apis/grpc/v1/vald/vald.go @@ -17,18 +17,17 @@ // Package vald provides vald server interface package vald -import ( - grpc "google.golang.org/grpc" -) +import grpc "google.golang.org/grpc" type Server interface { + FlushServer + IndexServer InsertServer + ObjectServer + RemoveServer + SearchServer UpdateServer UpsertServer - SearchServer - RemoveServer - FlushServer - ObjectServer } type ServerWithFilter interface { @@ -37,13 +36,14 @@ type ServerWithFilter interface { } type UnimplementedValdServer struct { + UnimplementedFlushServer + UnimplementedIndexServer UnimplementedInsertServer + UnimplementedObjectServer + UnimplementedRemoveServer + UnimplementedSearchServer UnimplementedUpdateServer UnimplementedUpsertServer - UnimplementedSearchServer - UnimplementedRemoveServer - UnimplementedFlushServer - UnimplementedObjectServer } type UnimplementedValdServerWithFilter struct { @@ -52,13 +52,14 @@ type UnimplementedValdServerWithFilter struct { } type Client interface { + FlushClient + IndexClient InsertClient + ObjectClient + RemoveClient + SearchClient UpdateClient UpsertClient - SearchClient - RemoveClient - FlushClient - ObjectClient } type ClientWithFilter interface { @@ -69,14 +70,15 @@ type ClientWithFilter interface { const PackageName = "vald.v1" const ( + FilterRPCServiceName = "Filter" + FlushRPCServiceName = "Flush" + IndexRPCServiceName = "Index" InsertRPCServiceName = "Insert" + ObjectRPCServiceName = "Object" + RemoveRPCServiceName = "Remove" + SearchRPCServiceName = "Search" UpdateRPCServiceName = "Update" UpsertRPCServiceName = "Upsert" - SearchRPCServiceName = "Search" - RemoveRPCServiceName = "Remove" - FlushRPCServiceName = "Flush" - ObjectRPCServiceName = "Object" - FilterRPCServiceName = "Filter" ) const ( @@ -132,26 +134,31 @@ const ( GetTimestampRPCName = "GetTimestamp" StreamGetObjectRPCName = "StreamGetObject" StreamListObjectRPCName = "StreamListObject" + + IndexInfoRPCName = "IndexInfo" + IndexDetailRPCName = "IndexDetail" ) type client struct { + FlushClient + IndexClient InsertClient + ObjectClient + RemoveClient + SearchClient UpdateClient UpsertClient - SearchClient - RemoveClient - FlushClient - ObjectClient } func RegisterValdServer(s *grpc.Server, srv Server) { + RegisterFlushServer(s, srv) + RegisterIndexServer(s, srv) RegisterInsertServer(s, srv) + RegisterObjectServer(s, srv) + RegisterRemoveServer(s, srv) + RegisterSearchServer(s, srv) RegisterUpdateServer(s, srv) RegisterUpsertServer(s, srv) - RegisterSearchServer(s, srv) - RegisterRemoveServer(s, srv) - RegisterFlushServer(s, srv) - RegisterObjectServer(s, srv) } func RegisterValdServerWithFilter(s *grpc.Server, srv ServerWithFilter) { @@ -161,12 +168,13 @@ func RegisterValdServerWithFilter(s *grpc.Server, srv ServerWithFilter) { func NewValdClient(conn *grpc.ClientConn) Client { return &client{ - NewInsertClient(conn), - NewUpdateClient(conn), - NewUpsertClient(conn), - NewSearchClient(conn), - NewRemoveClient(conn), - NewFlushClient(conn), - NewObjectClient(conn), + FlushClient: NewFlushClient(conn), + IndexClient: NewIndexClient(conn), + InsertClient: NewInsertClient(conn), + ObjectClient: NewObjectClient(conn), + RemoveClient: NewRemoveClient(conn), + SearchClient: NewSearchClient(conn), + UpdateClient: NewUpdateClient(conn), + UpsertClient: NewUpsertClient(conn), } } diff --git a/apis/proto/v1/agent/core/agent.proto b/apis/proto/v1/agent/core/agent.proto index 779f6a5b744..268778e380a 100644 --- a/apis/proto/v1/agent/core/agent.proto +++ b/apis/proto/v1/agent/core/agent.proto @@ -30,7 +30,7 @@ option java_package = "org.vdaas.vald.api.v1.agent.core"; service Agent { // Represent the creating index RPC. rpc CreateIndex(payload.v1.Control.CreateIndexRequest) returns (payload.v1.Empty) { - option (google.api.http).get = "/index/create"; + option (google.api.http).get = "/index/create/{pool_size}"; } // Represent the saving index RPC. @@ -40,16 +40,6 @@ service Agent { // Represent the creating and saving index RPC. rpc CreateAndSaveIndex(payload.v1.Control.CreateIndexRequest) returns (payload.v1.Empty) { - option (google.api.http).get = "/index/createandsave"; - } - - // Represent the RPC to get the agent index information. - rpc IndexInfo(payload.v1.Empty) returns (payload.v1.Info.Index.Count) { - option (google.api.http).get = "/index/info"; - } - - // Represent the RPC to get the vector metadata. This RPC is mainly used for index correction process - rpc GetTimestamp(payload.v1.Object.GetTimestampRequest) returns (payload.v1.Object.Timestamp) { - option (google.api.http).get = "/object/meta"; + option (google.api.http).get = "/index/createandsave/{pool_size}"; } } diff --git a/apis/proto/v1/payload/payload.proto b/apis/proto/v1/payload/payload.proto index 5f9af665a0e..2e5100f3185 100644 --- a/apis/proto/v1/payload/payload.proto +++ b/apis/proto/v1/payload/payload.proto @@ -392,7 +392,7 @@ message Object { } // Represent a request to fetch vector meta data. - message GetTimestampRequest { + message TimestampRequest { // The vector ID to be fetched. ID id = 1 [(buf.validate.field).repeated.min_items = 2]; } @@ -523,6 +523,15 @@ message Info { // The saving index count. bool saving = 4; } + // Represent the index count for each Agents message. + message Detail { + // count infos for each agents + map counts = 1; + // index replica of vald cluster + uint32 replica = 2; + // live agent replica of vald cluster + uint32 live_agents = 3; + } // Represent the UUID message. message UUID { diff --git a/apis/proto/v1/manager/index/index_manager.proto b/apis/proto/v1/vald/index.proto similarity index 72% rename from apis/proto/v1/manager/index/index_manager.proto rename to apis/proto/v1/vald/index.proto index a18f0c1bba1..2fd589588a9 100644 --- a/apis/proto/v1/manager/index/index_manager.proto +++ b/apis/proto/v1/vald/index.proto @@ -16,15 +16,15 @@ syntax = "proto3"; -package manager.index.v1; +package vald.v1; import "google/api/annotations.proto"; import "v1/payload/payload.proto"; -option go_package = "github.com/vdaas/vald/apis/grpc/v1/manager/index"; +option go_package = "github.com/vdaas/vald/apis/grpc/v1/vald"; option java_multiple_files = true; -option java_outer_classname = "ValdIndexManager"; -option java_package = "org.vdaas.vald.api.v1.manager.index"; +option java_outer_classname = "ValdIndex"; +option java_package = "org.vdaas.vald.api.v1.vald"; // Represent the index manager service. service Index { @@ -32,4 +32,8 @@ service Index { rpc IndexInfo(payload.v1.Empty) returns (payload.v1.Info.Index.Count) { option (google.api.http).get = "/index/info"; } + // Represent the RPC to get the index information for each agents. + rpc IndexDetail(payload.v1.Empty) returns (payload.v1.Info.Index.Detail) { + option (google.api.http).get = "/index/detail"; + } } diff --git a/apis/proto/v1/vald/object.proto b/apis/proto/v1/vald/object.proto index ee8f454b07b..73e5723381c 100644 --- a/apis/proto/v1/vald/object.proto +++ b/apis/proto/v1/vald/object.proto @@ -45,4 +45,9 @@ service Object { rpc StreamListObject(payload.v1.Object.List.Request) returns (stream payload.v1.Object.List.Response) { option (google.api.http).get = "/object/list"; } + + // Represent the RPC to get the vector metadata. This RPC is mainly used for index correction process + rpc GetTimestamp(payload.v1.Object.TimestampRequest) returns (payload.v1.Object.Timestamp) { + option (google.api.http).get = "/object/meta/{id.id}"; + } } diff --git a/apis/swagger/v1/agent/core/agent.swagger.json b/apis/swagger/v1/agent/core/agent.swagger.json index a3c2fda39b2..2abce5f2220 100644 --- a/apis/swagger/v1/agent/core/agent.swagger.json +++ b/apis/swagger/v1/agent/core/agent.swagger.json @@ -12,7 +12,7 @@ "consumes": ["application/json"], "produces": ["application/json"], "paths": { - "/index/create": { + "/index/create/{poolSize}": { "get": { "summary": "Represent the creating index RPC.", "operationId": "Agent_CreateIndex", @@ -34,8 +34,8 @@ { "name": "poolSize", "description": "The pool size of the create index operation.", - "in": "query", - "required": false, + "in": "path", + "required": true, "type": "integer", "format": "int64" } @@ -43,7 +43,7 @@ "tags": ["Agent"] } }, - "/index/createandsave": { + "/index/createandsave/{poolSize}": { "get": { "summary": "Represent the creating and saving index RPC.", "operationId": "Agent_CreateAndSaveIndex", @@ -65,8 +65,8 @@ { "name": "poolSize", "description": "The pool size of the create index operation.", - "in": "query", - "required": false, + "in": "path", + "required": true, "type": "integer", "format": "int64" } @@ -74,27 +74,6 @@ "tags": ["Agent"] } }, - "/index/info": { - "get": { - "summary": "Represent the RPC to get the agent index information.", - "operationId": "Agent_IndexInfo", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/IndexCount" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "tags": ["Agent"] - } - }, "/index/save": { "get": { "summary": "Represent the saving index RPC.", @@ -115,71 +94,9 @@ }, "tags": ["Agent"] } - }, - "/object/meta": { - "get": { - "summary": "Represent the RPC to get the vector metadata. This RPC is mainly used for index correction process", - "operationId": "Agent_GetTimestamp", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ObjectTimestamp" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "id.id", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": ["Agent"] - } } }, "definitions": { - "IndexCount": { - "type": "object", - "properties": { - "stored": { - "type": "integer", - "format": "int64", - "description": "The stored index count." - }, - "uncommitted": { - "type": "integer", - "format": "int64", - "description": "The uncommitted index count." - }, - "indexing": { - "type": "boolean", - "description": "The indexing index count." - }, - "saving": { - "type": "boolean", - "description": "The saving index count." - } - }, - "description": "Represent the index count message." - }, - "ObjectID": { - "type": "object", - "properties": { - "id": { - "type": "string" - } - }, - "description": "Represent the vector ID." - }, "protobufAny": { "type": "object", "properties": { @@ -217,21 +134,6 @@ "v1Empty": { "type": "object", "description": "Represent an empty message." - }, - "v1ObjectTimestamp": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The vector ID." - }, - "timestamp": { - "type": "string", - "format": "int64", - "description": "timestamp represents when this vector inserted." - } - }, - "description": "Represent a vector meta data." } } } diff --git a/apis/swagger/v1/manager/index/index_manager.swagger.json b/apis/swagger/v1/vald/index.swagger.json similarity index 84% rename from apis/swagger/v1/manager/index/index_manager.swagger.json rename to apis/swagger/v1/vald/index.swagger.json index 73a3c346cf3..6a0745eee22 100644 --- a/apis/swagger/v1/manager/index/index_manager.swagger.json +++ b/apis/swagger/v1/vald/index.swagger.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "v1/manager/index/index_manager.proto", + "title": "v1/vald/index.proto", "version": "version not set" }, "tags": [ @@ -12,6 +12,27 @@ "consumes": ["application/json"], "produces": ["application/json"], "paths": { + "/index/detail": { + "get": { + "summary": "Represent the RPC to get the index information for each agents.", + "operationId": "Index_IndexDetail", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/IndexDetail" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": ["Index"] + } + }, "/index/info": { "get": { "summary": "Represent the RPC to get the index information.", @@ -59,6 +80,29 @@ }, "description": "Represent the index count message." }, + "IndexDetail": { + "type": "object", + "properties": { + "counts": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/IndexCount" + }, + "title": "count infos for each agents" + }, + "replica": { + "type": "integer", + "format": "int64", + "title": "index replica of vald cluster" + }, + "liveAgents": { + "type": "integer", + "format": "int64", + "title": "live agent replica of vald cluster" + } + }, + "description": "Represent the index count for each Agents message." + }, "protobufAny": { "type": "object", "properties": { diff --git a/apis/swagger/v1/vald/object.swagger.json b/apis/swagger/v1/vald/object.swagger.json index de87f3948e7..263808e6d35 100644 --- a/apis/swagger/v1/vald/object.swagger.json +++ b/apis/swagger/v1/vald/object.swagger.json @@ -71,6 +71,35 @@ "tags": ["Object"] } }, + "/object/meta/{id.id}": { + "get": { + "summary": "Represent the RPC to get the vector metadata. This RPC is mainly used for index correction process", + "operationId": "Object_GetTimestamp", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ObjectTimestamp" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "id.id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": ["Object"] + } + }, "/object/{id.id}": { "get": { "summary": "A method to fetch a vector.", @@ -223,6 +252,21 @@ } }, "description": "Represent the target filter server." + }, + "v1ObjectTimestamp": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The vector ID." + }, + "timestamp": { + "type": "string", + "format": "int64", + "description": "timestamp represents when this vector inserted." + } + }, + "description": "Represent a vector meta data." } } } diff --git a/apis/swagger/v1/vald/remove.swagger.json b/apis/swagger/v1/vald/remove.swagger.json index b68f220b47d..c7fc1214266 100644 --- a/apis/swagger/v1/vald/remove.swagger.json +++ b/apis/swagger/v1/vald/remove.swagger.json @@ -101,7 +101,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/RemoveTimestampRequest" + "$ref": "#/definitions/v1RemoveTimestampRequest" } } ], @@ -146,20 +146,6 @@ }, "description": "Represent the stream response of the vector location." }, - "RemoveTimestampRequest": { - "type": "object", - "properties": { - "timestamps": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1RemoveTimestamp" - }, - "description": "The timestamp comparison list. If more than one is specified, the `AND` search is applied." - } - }, - "description": "Represent the remove request based on timestamp." - }, "TimestampOperator": { "type": "string", "enum": ["Eq", "Ne", "Ge", "Gt", "Le", "Lt"], @@ -278,6 +264,20 @@ } }, "description": "Represent the timestamp comparison." + }, + "v1RemoveTimestampRequest": { + "type": "object", + "properties": { + "timestamps": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1RemoveTimestamp" + }, + "description": "The timestamp comparison list. If more than one is specified, the `AND` search is applied." + } + }, + "description": "Represent the remove request based on timestamp." } } } diff --git a/assets/test/templates/option/function.tmpl b/assets/test/templates/option/function.tmpl index 42d4952270a..72d48a75bc7 100644 --- a/assets/test/templates/option/function.tmpl +++ b/assets/test/templates/option/function.tmpl @@ -3,7 +3,7 @@ func {{ .TestName }}(t *testing.T) { // Change interface type to the type of object you are testing - type T = interface{} + type T = any {{- if .TestParameters }} type args struct { {{- range .TestParameters }} diff --git a/charts/vald-helm-operator/templates/operator.yaml b/charts/vald-helm-operator/templates/operator.yaml index d34793bbe4e..4603efb3a84 100644 --- a/charts/vald-helm-operator/templates/operator.yaml +++ b/charts/vald-helm-operator/templates/operator.yaml @@ -53,8 +53,6 @@ spec: image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} args: - - "run" - - "--watches-file=./watches.yaml" {{- if .Values.enableLeaderElection }} - "--leader-elect" - "--leader-election-id={{ default .Values.name .Values.leaderElectionID }}" diff --git a/charts/vald/README.md b/charts/vald/README.md index 593b000f7af..36ca5b06c3a 100644 --- a/charts/vald/README.md +++ b/charts/vald/README.md @@ -61,6 +61,28 @@ Run the following command to install the chart, | agent.enabled | bool | `true` | agent enabled | | agent.env | list | `[{"name":"MY_NODE_NAME","valueFrom":{"fieldRef":{"fieldPath":"spec.nodeName"}}},{"name":"MY_POD_NAME","valueFrom":{"fieldRef":{"fieldPath":"metadata.name"}}},{"name":"MY_POD_NAMESPACE","valueFrom":{"fieldRef":{"fieldPath":"metadata.namespace"}}}]` | environment variables | | agent.externalTrafficPolicy | string | `""` | external traffic policy (can be specified when service type is LoadBalancer or NodePort) : Cluster or Local | +| agent.faiss.auto_index_check_duration | string | `"30m"` | check duration of automatic indexing | +| agent.faiss.auto_index_duration_limit | string | `"24h"` | limit duration of automatic indexing | +| agent.faiss.auto_index_length | int | `100` | number of cache to trigger automatic indexing | +| agent.faiss.auto_save_index_duration | string | `"35m"` | duration of automatic save index | +| agent.faiss.dimension | int | `4096` | vector dimension | +| agent.faiss.enable_copy_on_write | bool | `false` | enable copy on write saving for more stable backup | +| agent.faiss.enable_in_memory_mode | bool | `true` | in-memory mode enabled | +| agent.faiss.enable_proactive_gc | bool | `false` | enable proactive GC call for reducing heap memory allocation | +| agent.faiss.index_path | string | `""` | path to index data | +| agent.faiss.initial_delay_max_duration | string | `"3m"` | maximum duration for initial delay | +| agent.faiss.kvsdb.concurrency | int | `6` | kvsdb processing concurrency | +| agent.faiss.load_index_timeout_factor | string | `"1ms"` | a factor of load index timeout. timeout duration will be calculated by (index count to be loaded) \* (factor). | +| agent.faiss.m | int | `8` | | +| agent.faiss.max_load_index_timeout | string | `"10m"` | maximum duration of load index timeout | +| agent.faiss.metric_type | string | `"l2"` | | +| agent.faiss.min_load_index_timeout | string | `"3m"` | minimum duration of load index timeout | +| agent.faiss.namespace | string | `"_MY_POD_NAMESPACE_"` | namespace of myself | +| agent.faiss.nbits_per_idx | int | `8` | | +| agent.faiss.nlist | int | `100` | | +| agent.faiss.pod_name | string | `"_MY_POD_NAME_"` | pod name of myself | +| agent.faiss.vqueue.delete_buffer_pool_size | int | `5000` | delete slice pool buffer size | +| agent.faiss.vqueue.insert_buffer_pool_size | int | `10000` | insert slice pool buffer size | | agent.hpa.enabled | bool | `false` | HPA enabled | | agent.hpa.targetCPUUtilizationPercentage | int | `80` | HPA CPU utilization percentage | | agent.image.pullPolicy | string | `"Always"` | image pull policy | diff --git a/charts/vald/templates/gateway/filter/configmap.yaml b/charts/vald/templates/gateway/filter/configmap.yaml index 15d49ae3117..45480d466d5 100644 --- a/charts/vald/templates/gateway/filter/configmap.yaml +++ b/charts/vald/templates/gateway/filter/configmap.yaml @@ -16,6 +16,7 @@ {{- $gateway := .Values.gateway.filter -}} {{- $lb := .Values.gateway.lb -}} {{- $agent := .Values.agent -}} +{{- $mirror := .Values.gateway.mirror -}} {{- if $gateway.enabled }} apiVersion: v1 kind: ConfigMap @@ -44,7 +45,14 @@ data: {{- include "vald.observability" $observability | nindent 6 }} client: {{- $nextGatewayClient := $gateway.gateway_config.gateway_client }} - {{- if $lb.enabled -}} + {{- if $mirror.enabled -}} + {{- $mirrorServerPort := $mirror.server_config.servers.grpc.port }} + {{- $defaultMirrorHost := printf "%s.%s.svc.cluster.local" $mirror.name .Release.Namespace }} + {{- $defaultMirrorPort := default .Values.defaults.server_config.servers.grpc.port $mirrorServerPort }} + {{- $defaultMirrorAddr := (list (printf "%s:%d" $defaultMirrorHost (int64 $defaultMirrorPort))) }} + {{- $mirrorAddrs := dict "Values" $nextGatewayClient.addrs "default" $defaultMirrorAddr }} + {{- include "vald.grpc.client.addrs" $mirrorAddrs | nindent 6 }} + {{- else if $lb.enabled -}} {{- $lbServerPort := $lb.server_config.servers.grpc.port }} {{- $defaultLBHost := printf "%s.%s.svc.cluster.local" $lb.name .Release.Namespace }} {{- $defaultLBPort := default .Values.defaults.server_config.servers.grpc.port $lbServerPort }} @@ -70,25 +78,25 @@ data: {{- include "vald.grpc.client" $ingressFilterGRPCClient | nindent 8 }} vectorizer: {{ $gateway.gateway_config.ingress_filter.vectorizer | quote }} {{- if $gateway.gateway_config.ingress_filter.search_filters }} - search_filters: + search_filters: {{- toYaml $gateway.gateway_config.ingress_filter.search_filters | nindent 8 }} {{- else }} search_filters: [] {{- end }} {{- if $gateway.gateway_config.ingress_filter.insert_filters }} - insert_filters: + insert_filters: {{- toYaml $gateway.gateway_config.ingress_filter.insert_filters | nindent 8 }} {{- else }} insert_filters: [] {{- end }} {{- if $gateway.gateway_config.ingress_filter.update_filters }} - update_filters: + update_filters: {{- toYaml $gateway.gateway_config.ingress_filter.update_filters | nindent 8 }} {{- else }} update_filters: [] {{- end }} {{- if $gateway.gateway_config.ingress_filter.upsert_filters }} - upsert_filters: + upsert_filters: {{- toYaml $gateway.gateway_config.ingress_filter.upsert_filters | nindent 8 }} {{- else }} upsert_filters: [] @@ -101,13 +109,13 @@ data: {{- $egressFilterGRPCClient := dict "Values" $egressFilterClient "default" .Values.defaults.grpc.client }} {{- include "vald.grpc.client" $egressFilterGRPCClient | nindent 8 }} {{- if $gateway.gateway_config.egress_filter.object_filters }} - object_filters: + object_filters: {{- toYaml $gateway.gateway_config.egress_filter.object_filters | nindent 8 }} {{- else }} object_filters: [] {{- end }} {{- if $gateway.gateway_config.egress_filter.distance_filters }} - distance_filters: + distance_filters: {{- toYaml $gateway.gateway_config.egress_filter.distance_filters | nindent 8 }} {{- else }} distance_filters: [] diff --git a/charts/vald/templates/gateway/ing.yaml b/charts/vald/templates/gateway/ing.yaml index d9dff5060c6..f417c04f8bd 100644 --- a/charts/vald/templates/gateway/ing.yaml +++ b/charts/vald/templates/gateway/ing.yaml @@ -62,7 +62,79 @@ spec: - host: {{ $gateway.ingress.host }} http: paths: - {{- if $filterIngEnabled }} + {{- if and $mirrorIngEnabled $filterIngEnabled $lb.enabled }} + - path: "/vald.v1.Search" + backend: + service: + name: {{ $filter.name }} + {{- include "vald.ingressPort" (dict "Values" $filter.ingress) | nindent 12 }} + pathType: {{ $filter.ingress.pathType }} + - path: "/vald.v1.Insert" + backend: + service: + name: {{ $filter.name }} + {{- include "vald.ingressPort" (dict "Values" $filter.ingress) | nindent 12 }} + pathType: {{ $filter.ingress.pathType }} + - path: "/vald.v1.Update" + backend: + service: + name: {{ $filter.name }} + {{- include "vald.ingressPort" (dict "Values" $filter.ingress) | nindent 12 }} + pathType: {{ $filter.ingress.pathType }} + - path: "/vald.v1.Upsert" + backend: + service: + name: {{ $filter.name }} + {{- include "vald.ingressPort" (dict "Values" $filter.ingress) | nindent 12 }} + pathType: {{ $filter.ingress.pathType }} + - path: "/vald.v1.Index" + backend: + service: + name: {{ $lb.name }} + {{- include "vald.ingressPort" (dict "Values" $lb.ingress) | nindent 12 }} + pathType: {{ $lb.ingress.pathType }} + - path: "/vald.v1.Object.Exists" + backend: + service: + name: {{ $lb.name }} + {{- include "vald.ingressPort" (dict "Values" $lb.ingress) | nindent 12 }} + pathType: {{ $lb.ingress.pathType }} + - path: "/vald.v1.Object.GetTimestamp" + backend: + service: + name: {{ $lb.name }} + {{- include "vald.ingressPort" (dict "Values" $lb.ingress) | nindent 12 }} + pathType: {{ $lb.ingress.pathType }} + - path: "/vald.v1.Object" + backend: + service: + name: {{ $filter.name }} + {{- include "vald.ingressPort" (dict "Values" $lb.ingress) | nindent 12 }} + pathType: {{ $filter.ingress.pathType }} + - backend: + service: + name: {{ $mirror.name }} + {{- include "vald.ingressPort" (dict "Values" $mirror.ingress) | nindent 12 }} + pathType: {{ $mirror.ingress.pathType }} + {{- else if and $filterIngEnabled $lb.enabled }} + - path: "/vald.v1.Index" + backend: + service: + name: {{ $lb.name }} + {{- include "vald.ingressPort" (dict "Values" $lb.ingress) | nindent 12 }} + pathType: {{ $lb.ingress.pathType }} + - path: "/vald.v1.Object.Exists" + backend: + service: + name: {{ $lb.name }} + {{- include "vald.ingressPort" (dict "Values" $lb.ingress) | nindent 12 }} + pathType: {{ $lb.ingress.pathType }} + - path: "/vald.v1.Object.GetTimestamp" + backend: + service: + name: {{ $lb.name }} + {{- include "vald.ingressPort" (dict "Values" $lb.ingress) | nindent 12 }} + pathType: {{ $lb.ingress.pathType }} - backend: service: name: {{ $filter.name }} @@ -74,13 +146,31 @@ spec: service: name: {{ $lb.name }} {{- include "vald.ingressPort" (dict "Values" $lb.ingress) | nindent 12 }} - pathType: {{ $mirror.ingress.pathType }} + pathType: {{ $lb.ingress.pathType }} + - path: "/vald.v1.Index" + backend: + service: + name: {{ $lb.name }} + {{- include "vald.ingressPort" (dict "Values" $lb.ingress) | nindent 12 }} + pathType: {{ $lb.ingress.pathType }} + - path: "/vald.v1.Object.Exists" + backend: + service: + name: {{ $lb.name }} + {{- include "vald.ingressPort" (dict "Values" $lb.ingress) | nindent 12 }} + pathType: {{ $lb.ingress.pathType }} + - path: "/vald.v1.Object.GetTimestamp" + backend: + service: + name: {{ $lb.name }} + {{- include "vald.ingressPort" (dict "Values" $lb.ingress) | nindent 12 }} + pathType: {{ $lb.ingress.pathType }} - path: "/vald.v1.Object" backend: service: name: {{ $lb.name }} {{- include "vald.ingressPort" (dict "Values" $lb.ingress) | nindent 12 }} - pathType: {{ $mirror.ingress.pathType }} + pathType: {{ $lb.ingress.pathType }} - backend: service: name: {{ $mirror.name }} diff --git a/charts/vald/values.go b/charts/vald/values.go index 318b87248a6..58e835e21d7 100644 --- a/charts/vald/values.go +++ b/charts/vald/values.go @@ -13,9 +13,7 @@ // limitations under the License. package vald -import ( - "github.com/vdaas/vald/internal/config" -) +import "github.com/vdaas/vald/internal/config" // Affinity. type Affinity struct { diff --git a/charts/vald/values.schema.json b/charts/vald/values.schema.json index ef9c647eb71..b7f77c19365 100644 --- a/charts/vald/values.schema.json +++ b/charts/vald/values.schema.json @@ -103,6 +103,98 @@ "type": "string", "description": "external traffic policy (can be specified when service type is LoadBalancer or NodePort) : Cluster or Local" }, + "faiss": { + "type": "object", + "properties": { + "auto_index_check_duration": { + "type": "string", + "description": "check duration of automatic indexing" + }, + "auto_index_duration_limit": { + "type": "string", + "description": "limit duration of automatic indexing" + }, + "auto_index_length": { + "type": "integer", + "description": "number of cache to trigger automatic indexing" + }, + "auto_save_index_duration": { + "type": "string", + "description": "duration of automatic save index" + }, + "dimension": { + "type": "integer", + "description": "vector dimension", + "minimum": 1 + }, + "enable_copy_on_write": { + "type": "boolean", + "description": "enable copy on write saving for more stable backup" + }, + "enable_in_memory_mode": { + "type": "boolean", + "description": "in-memory mode enabled" + }, + "enable_proactive_gc": { + "type": "boolean", + "description": "enable proactive GC call for reducing heap memory allocation" + }, + "index_path": { + "type": "string", + "description": "path to index data" + }, + "initial_delay_max_duration": { + "type": "string", + "description": "maximum duration for initial delay" + }, + "kvsdb": { + "type": "object", + "properties": { + "concurrency": { + "type": "integer", + "description": "kvsdb processing concurrency" + } + } + }, + "load_index_timeout_factor": { + "type": "string", + "description": "a factor of load index timeout. timeout duration will be calculated by (index count to be loaded) * (factor)." + }, + "m": { "type": "integer" }, + "max_load_index_timeout": { + "type": "string", + "description": "maximum duration of load index timeout" + }, + "metric_type": { "type": "string", "enum": ["innerproduct", "l2"] }, + "min_load_index_timeout": { + "type": "string", + "description": "minimum duration of load index timeout" + }, + "namespace": { + "type": "string", + "description": "namespace of myself" + }, + "nbits_per_idx": { "type": "integer" }, + "nlist": { "type": "integer" }, + "pod_name": { + "type": "string", + "description": "pod name of myself" + }, + "vqueue": { + "type": "object", + "properties": { + "delete_buffer_pool_size": { + "type": "integer", + "description": "delete slice pool buffer size" + }, + "insert_buffer_pool_size": { + "type": "integer", + "description": "insert slice pool buffer size" + } + } + } + } + }, "hpa": { "type": "object", "properties": { diff --git a/cmd/agent/core/faiss/main.go b/cmd/agent/core/faiss/main.go index 3c78d90e65d..87ce7d2f4ed 100644 --- a/cmd/agent/core/faiss/main.go +++ b/cmd/agent/core/faiss/main.go @@ -41,14 +41,14 @@ func main() { context.Background(), runner.WithName(name), runner.WithVersion(info.Version, maxVersion, minVersion), - runner.WithConfigLoader(func(path string) (interface{}, *config.GlobalConfig, error) { + runner.WithConfigLoader(func(path string) (any, *config.GlobalConfig, error) { cfg, err := config.NewConfig(path) if err != nil { return nil, nil, errors.Wrap(err, "failed to load "+name+"'s configuration") } return cfg, &cfg.GlobalConfig, nil }), - runner.WithDaemonInitializer(func(cfg interface{}) (runner.Runner, error) { + runner.WithDaemonInitializer(func(cfg any) (runner.Runner, error) { return usecase.New(cfg.(*config.Data)) }), ) diff --git a/cmd/agent/core/ngt/main.go b/cmd/agent/core/ngt/main.go index c5365673a49..ac27a0842f2 100644 --- a/cmd/agent/core/ngt/main.go +++ b/cmd/agent/core/ngt/main.go @@ -41,14 +41,14 @@ func main() { context.Background(), runner.WithName(name), runner.WithVersion(info.Version, maxVersion, minVersion), - runner.WithConfigLoader(func(path string) (interface{}, *config.GlobalConfig, error) { + runner.WithConfigLoader(func(path string) (any, *config.GlobalConfig, error) { cfg, err := config.NewConfig(path) if err != nil { return nil, nil, errors.Wrap(err, "failed to load "+name+"'s configuration") } return cfg, &cfg.GlobalConfig, nil }), - runner.WithDaemonInitializer(func(cfg interface{}) (runner.Runner, error) { + runner.WithDaemonInitializer(func(cfg any) (runner.Runner, error) { return usecase.New(cfg.(*config.Data)) }), ) diff --git a/cmd/agent/sidecar/main.go b/cmd/agent/sidecar/main.go index 90fbf9cd633..1e32ab72fd1 100644 --- a/cmd/agent/sidecar/main.go +++ b/cmd/agent/sidecar/main.go @@ -41,14 +41,14 @@ func main() { context.Background(), runner.WithName(name), runner.WithVersion(info.Version, maxVersion, minVersion), - runner.WithConfigLoader(func(path string) (interface{}, *config.GlobalConfig, error) { + runner.WithConfigLoader(func(path string) (any, *config.GlobalConfig, error) { cfg, err := config.NewConfig(path) if err != nil { return nil, nil, errors.Wrap(err, "failed to load "+name+"'s configuration") } return cfg, &cfg.GlobalConfig, nil }), - runner.WithDaemonInitializer(func(cfg interface{}) (runner.Runner, error) { + runner.WithDaemonInitializer(func(cfg any) (runner.Runner, error) { return usecase.New(cfg.(*config.Data)) }), ) diff --git a/cmd/discoverer/k8s/main.go b/cmd/discoverer/k8s/main.go index bf50866778d..a0a4242fa30 100644 --- a/cmd/discoverer/k8s/main.go +++ b/cmd/discoverer/k8s/main.go @@ -41,14 +41,14 @@ func main() { context.Background(), runner.WithName(name), runner.WithVersion(info.Version, maxVersion, minVersion), - runner.WithConfigLoader(func(path string) (interface{}, *config.GlobalConfig, error) { + runner.WithConfigLoader(func(path string) (any, *config.GlobalConfig, error) { cfg, err := config.NewConfig(path) if err != nil { return nil, nil, errors.Wrap(err, "failed to load "+name+"'s configuration") } return cfg, &cfg.GlobalConfig, nil }), - runner.WithDaemonInitializer(func(cfg interface{}) (runner.Runner, error) { + runner.WithDaemonInitializer(func(cfg any) (runner.Runner, error) { return usecase.New(cfg.(*config.Data)) }), ) diff --git a/cmd/gateway/filter/main.go b/cmd/gateway/filter/main.go index 675d91cb795..fa5be90444b 100644 --- a/cmd/gateway/filter/main.go +++ b/cmd/gateway/filter/main.go @@ -41,14 +41,14 @@ func main() { context.Background(), runner.WithName(name), runner.WithVersion(info.Version, maxVersion, minVersion), - runner.WithConfigLoader(func(path string) (interface{}, *config.GlobalConfig, error) { + runner.WithConfigLoader(func(path string) (any, *config.GlobalConfig, error) { cfg, err := config.NewConfig(path) if err != nil { return nil, nil, errors.Wrap(err, "failed to load "+name+"'s configuration") } return cfg, &cfg.GlobalConfig, nil }), - runner.WithDaemonInitializer(func(cfg interface{}) (runner.Runner, error) { + runner.WithDaemonInitializer(func(cfg any) (runner.Runner, error) { return usecase.New(cfg.(*config.Data)) }), ) diff --git a/cmd/gateway/lb/main.go b/cmd/gateway/lb/main.go index 4fe52099e79..c1ec67e64f7 100644 --- a/cmd/gateway/lb/main.go +++ b/cmd/gateway/lb/main.go @@ -41,14 +41,14 @@ func main() { context.Background(), runner.WithName(name), runner.WithVersion(info.Version, maxVersion, minVersion), - runner.WithConfigLoader(func(path string) (interface{}, *config.GlobalConfig, error) { + runner.WithConfigLoader(func(path string) (any, *config.GlobalConfig, error) { cfg, err := config.NewConfig(path) if err != nil { return nil, nil, errors.Wrap(err, "failed to load "+name+"'s configuration") } return cfg, &cfg.GlobalConfig, nil }), - runner.WithDaemonInitializer(func(cfg interface{}) (runner.Runner, error) { + runner.WithDaemonInitializer(func(cfg any) (runner.Runner, error) { return usecase.New(cfg.(*config.Data)) }), ) diff --git a/cmd/gateway/mirror/main.go b/cmd/gateway/mirror/main.go index ed7658c40dd..a535835e39f 100644 --- a/cmd/gateway/mirror/main.go +++ b/cmd/gateway/mirror/main.go @@ -37,14 +37,14 @@ func main() { context.Background(), runner.WithName(name), runner.WithVersion(info.Version, maxVersion, minVersion), - runner.WithConfigLoader(func(path string) (interface{}, *config.GlobalConfig, error) { + runner.WithConfigLoader(func(path string) (any, *config.GlobalConfig, error) { cfg, err := config.NewConfig(path) if err != nil { return nil, nil, errors.Wrap(err, "failed to load "+name+"'s configuration") } return cfg, &cfg.GlobalConfig, nil }), - runner.WithDaemonInitializer(func(cfg interface{}) (runner.Runner, error) { + runner.WithDaemonInitializer(func(cfg any) (runner.Runner, error) { c, ok := cfg.(*config.Data) if !ok { return nil, errors.ErrInvalidConfig diff --git a/cmd/index/job/correction/main.go b/cmd/index/job/correction/main.go index 60677484032..705f4f5e20e 100644 --- a/cmd/index/job/correction/main.go +++ b/cmd/index/job/correction/main.go @@ -37,14 +37,14 @@ func main() { context.Background(), runner.WithName(name), runner.WithVersion(info.Version, maxVersion, minVersion), - runner.WithConfigLoader(func(path string) (interface{}, *config.GlobalConfig, error) { + runner.WithConfigLoader(func(path string) (any, *config.GlobalConfig, error) { cfg, err := config.NewConfig(path) if err != nil { return nil, nil, errors.Wrap(err, "failed to load "+name+"'s configuration") } return cfg, &cfg.GlobalConfig, nil }), - runner.WithDaemonInitializer(func(cfg interface{}) (runner.Runner, error) { + runner.WithDaemonInitializer(func(cfg any) (runner.Runner, error) { c, ok := cfg.(*config.Data) if !ok { return nil, errors.ErrInvalidConfig diff --git a/cmd/index/job/creation/main.go b/cmd/index/job/creation/main.go index c17b3b32098..f43bb58715e 100644 --- a/cmd/index/job/creation/main.go +++ b/cmd/index/job/creation/main.go @@ -37,14 +37,14 @@ func main() { context.Background(), runner.WithName(name), runner.WithVersion(info.Version, maxVersion, minVersion), - runner.WithConfigLoader(func(path string) (interface{}, *config.GlobalConfig, error) { + runner.WithConfigLoader(func(path string) (any, *config.GlobalConfig, error) { cfg, err := config.NewConfig(path) if err != nil { return nil, nil, errors.Wrap(err, "failed to load "+name+"'s configuration") } return cfg, &cfg.GlobalConfig, nil }), - runner.WithDaemonInitializer(func(cfg interface{}) (runner.Runner, error) { + runner.WithDaemonInitializer(func(cfg any) (runner.Runner, error) { c, ok := cfg.(*config.Data) if !ok { return nil, errors.ErrInvalidConfig diff --git a/cmd/index/job/readreplica/rotate/main.go b/cmd/index/job/readreplica/rotate/main.go index b35315e1c8c..fe23e3c3a3c 100644 --- a/cmd/index/job/readreplica/rotate/main.go +++ b/cmd/index/job/readreplica/rotate/main.go @@ -37,14 +37,14 @@ func main() { context.Background(), runner.WithName(name), runner.WithVersion(info.Version, maxVersion, minVersion), - runner.WithConfigLoader(func(path string) (interface{}, *config.GlobalConfig, error) { + runner.WithConfigLoader(func(path string) (any, *config.GlobalConfig, error) { cfg, err := config.NewConfig(path) if err != nil { return nil, nil, errors.Wrap(err, "failed to load "+name+"'s configuration") } return cfg, &cfg.GlobalConfig, nil }), - runner.WithDaemonInitializer(func(cfg interface{}) (runner.Runner, error) { + runner.WithDaemonInitializer(func(cfg any) (runner.Runner, error) { c, ok := cfg.(*config.Data) if !ok { return nil, errors.ErrInvalidConfig diff --git a/cmd/index/job/save/main.go b/cmd/index/job/save/main.go index 5c753b06866..a5b445ca8b3 100644 --- a/cmd/index/job/save/main.go +++ b/cmd/index/job/save/main.go @@ -37,14 +37,14 @@ func main() { context.Background(), runner.WithName(name), runner.WithVersion(info.Version, maxVersion, minVersion), - runner.WithConfigLoader(func(path string) (interface{}, *config.GlobalConfig, error) { + runner.WithConfigLoader(func(path string) (any, *config.GlobalConfig, error) { cfg, err := config.NewConfig(path) if err != nil { return nil, nil, errors.Wrap(err, "failed to load "+name+"'s configuration") } return cfg, &cfg.GlobalConfig, nil }), - runner.WithDaemonInitializer(func(cfg interface{}) (runner.Runner, error) { + runner.WithDaemonInitializer(func(cfg any) (runner.Runner, error) { c, ok := cfg.(*config.Data) if !ok { return nil, errors.ErrInvalidConfig diff --git a/cmd/index/operator/main.go b/cmd/index/operator/main.go index d09c1dfb780..bcff12d18e0 100644 --- a/cmd/index/operator/main.go +++ b/cmd/index/operator/main.go @@ -37,14 +37,14 @@ func main() { context.Background(), runner.WithName(name), runner.WithVersion(info.Version, maxVersion, minVersion), - runner.WithConfigLoader(func(path string) (interface{}, *config.GlobalConfig, error) { + runner.WithConfigLoader(func(path string) (any, *config.GlobalConfig, error) { cfg, err := config.NewConfig(path) if err != nil { return nil, nil, errors.Wrap(err, "failed to load "+name+"'s configuration") } return cfg, &cfg.GlobalConfig, nil }), - runner.WithDaemonInitializer(func(cfg interface{}) (runner.Runner, error) { + runner.WithDaemonInitializer(func(cfg any) (runner.Runner, error) { c, ok := cfg.(*config.Data) if !ok { return nil, errors.ErrInvalidConfig diff --git a/cmd/manager/index/main.go b/cmd/manager/index/main.go index 6d4dfb01ef9..ea7bfa6e467 100644 --- a/cmd/manager/index/main.go +++ b/cmd/manager/index/main.go @@ -41,14 +41,14 @@ func main() { context.Background(), runner.WithName(name), runner.WithVersion(info.Version, maxVersion, minVersion), - runner.WithConfigLoader(func(path string) (interface{}, *config.GlobalConfig, error) { + runner.WithConfigLoader(func(path string) (any, *config.GlobalConfig, error) { cfg, err := config.NewConfig(path) if err != nil { return nil, nil, errors.Wrap(err, "failed to load "+name+"'s configuration") } return cfg, &cfg.GlobalConfig, nil }), - runner.WithDaemonInitializer(func(cfg interface{}) (runner.Runner, error) { + runner.WithDaemonInitializer(func(cfg any) (runner.Runner, error) { return usecase.New(cfg.(*config.Data)) }), ) diff --git a/cmd/tools/benchmark/job/main.go b/cmd/tools/benchmark/job/main.go index c7badde186a..b24ade20842 100644 --- a/cmd/tools/benchmark/job/main.go +++ b/cmd/tools/benchmark/job/main.go @@ -42,14 +42,14 @@ func main() { ctx, runner.WithName(name), runner.WithVersion(info.Version, maxVersion, minVersion), - runner.WithConfigLoader(func(path string) (interface{}, *config.GlobalConfig, error) { + runner.WithConfigLoader(func(path string) (any, *config.GlobalConfig, error) { cfg, err := config.NewConfig(ctx, path) if err != nil { return nil, nil, errors.Wrap(err, "failed to load "+name+"'s configuration") } return cfg, &cfg.GlobalConfig, nil }), - runner.WithDaemonInitializer(func(cfg interface{}) (runner.Runner, error) { + runner.WithDaemonInitializer(func(cfg any) (runner.Runner, error) { return usecase.New(cfg.(*config.Config)) }), ) diff --git a/cmd/tools/benchmark/operator/main.go b/cmd/tools/benchmark/operator/main.go index 6d3e2d0d12d..3975ca246eb 100644 --- a/cmd/tools/benchmark/operator/main.go +++ b/cmd/tools/benchmark/operator/main.go @@ -41,14 +41,14 @@ func main() { context.Background(), runner.WithName(name), runner.WithVersion(info.Version, maxVersion, minVersion), - runner.WithConfigLoader(func(path string) (interface{}, *config.GlobalConfig, error) { + runner.WithConfigLoader(func(path string) (any, *config.GlobalConfig, error) { cfg, err := config.NewConfig(path) if err != nil { return nil, nil, errors.Wrap(err, "failed to load "+name+"'s configuration") } return cfg, &cfg.GlobalConfig, nil }), - runner.WithDaemonInitializer(func(cfg interface{}) (runner.Runner, error) { + runner.WithDaemonInitializer(func(cfg any) (runner.Runner, error) { return usecase.New(cfg.(*config.Config)) }), ) diff --git a/cmd/tools/cli/benchmark/core/main.go b/cmd/tools/cli/benchmark/core/main.go index 4a1c41baef1..02e86854455 100644 --- a/cmd/tools/cli/benchmark/core/main.go +++ b/cmd/tools/cli/benchmark/core/main.go @@ -163,7 +163,7 @@ func main() { var m runtime.MemStats runtime.ReadMemStats(&m) - metrics := []interface{}{ + metrics := []any{ header, vmpeak, vmsize, @@ -346,7 +346,16 @@ func main() { }) } -func run(ctx context.Context, load bool, path string, dim int, vectors [][]float32, ids []uint, dur time.Duration, output func(header string)) { +func run( + ctx context.Context, + load bool, + path string, + dim int, + vectors [][]float32, + ids []uint, + dur time.Duration, + output func(header string), +) { const poolSize = 8 var n ngt.NGT if load { diff --git a/cmd/tools/cli/loadtest/main.go b/cmd/tools/cli/loadtest/main.go index d784d2d924b..205cf869338 100644 --- a/cmd/tools/cli/loadtest/main.go +++ b/cmd/tools/cli/loadtest/main.go @@ -37,14 +37,14 @@ func main() { context.Background(), runner.WithName(name), runner.WithVersion(info.Version, maxVersion, minVersion), - runner.WithConfigLoader(func(path string) (interface{}, *config.GlobalConfig, error) { + runner.WithConfigLoader(func(path string) (any, *config.GlobalConfig, error) { cfg, err := config.NewConfig(path) if err != nil { return nil, nil, errors.Wrap(err, "failed to load "+name+"'s configuration") } return cfg, &cfg.GlobalConfig, nil }), - runner.WithDaemonInitializer(func(cfg interface{}) (runner.Runner, error) { + runner.WithDaemonInitializer(func(cfg any) (runner.Runner, error) { return usecase.New(cfg.(*config.Data)) }), ) diff --git a/dockers/agent/core/agent/Dockerfile b/dockers/agent/core/agent/Dockerfile index 726571fac63..7a7ac0b4515 100644 --- a/dockers/agent/core/agent/Dockerfile +++ b/dockers/agent/core/agent/Dockerfile @@ -15,81 +15,84 @@ # limitations under the License. # -ARG DISTROLESS_IMAGE=gcr.io/distroless/cc-debian12 -ARG DISTROLESS_IMAGE_TAG=nonroot -ARG MAINTAINER="vdaas.org vald team " +# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go -FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder +ARG UPX_OPTIONS=-9 +# skipcq: DOK-DL3026 +FROM ghcr.io/vdaas/vald/vald-buildbase:nightly AS builder +ARG MAINTAINER="vdaas.org vald team " +LABEL maintainer="${MAINTAINER}" ARG TARGETARCH ARG TARGETOS +ARG GO_VERSION ARG RUST_VERSION - -ENV RUST_HOME /usr/local/lib/rust -ENV RUSTUP_HOME ${RUST_HOME}/rustup -ENV CARGO_HOME ${RUST_HOME}/cargo -ENV DEBIAN_FRONTEND noninteractive -ENV INITRD No -ENV LANG en_US.UTF-8 -ENV PATH ${PATH}:${RUSTUP_HOME}/bin:${CARGO_HOME}/bin -ENV ORG vdaas -ENV REPO vald -ENV PKG agent/core/ngt -ENV APP_NAME ngt - +ENV APP_NAME=agent +ENV DEBIAN_FRONTEND=noninteractive +ENV HOME=/root +ENV INITRD=No +ENV LANG=en_US.UTF-8 +ENV ORG=vdaas +ENV PKG=agent/core/agent +ENV REPO=vald +ENV RUST_HOME=/usr/loacl/lib/rust +ENV RUSTUP_HOME=${RUST_HOME}/rustup +ENV CARGO_HOME=${RUST_HOME}/cargo +ENV PATH=${CARGO_HOME}/bin:${RUSTUP_HOME}/bin:/usr/local/bin:${PATH} + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] # skipcq: DOK-DL3008 -RUN apt-get update && apt-get install -y --no-install-recommends \ +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 \ - cmake \ curl \ + git \ + cmake \ g++ \ gcc \ - git \ + unzip \ liblapack-dev \ libomp-dev \ libopenblas-dev \ - unzip \ - upx \ + gfortran \ && ldconfig \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d -COPY Makefile.d . + && rm -rf \ + /var/lib/apt/lists/* \ + /var/cache/* \ + && apt-get autoremove -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} +WORKDIR ${HOME}/rust/src/github.com/${ORG}/${REPO} COPY Makefile . COPY .git . - -RUN make RUST_VERSION=${RUST_VERSION} rust/install - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd -COPY cmd . - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions +WORKDIR ${HOME}/rust/src/github.com/${ORG}/${REPO}/Makefile.d +COPY Makefile.d . +WORKDIR ${HOME}/rust/src/github.com/${ORG}/${REPO}/versions COPY versions . - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/rust +WORKDIR ${HOME}/rust/src/github.com/${ORG}/${REPO}/rust COPY rust . -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} -RUN make ngt/install - -RUN make rust/target/release/agent \ - && mv ./rust/target/release/agent "/usr/bin/${APP_NAME}" - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} -RUN cp sample.yaml /tmp/config.yaml - -FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +WORKDIR ${HOME}/rust/src/github.com/${ORG}/${REPO} +#skipcq: DOK-W1001, DOK-SC2086 +RUN make RUST_VERSION="${RUST_VERSION}" rust/install \ + && make ngt/install \ + && make faiss/install \ + && make rust/target/release/${APP_NAME} \ + && mv "rust/target/release/${APP_NAME}" "/usr/bin/${APP_NAME}" \ + && rm -rf rust/target +# skipcq: DOK-DL3026 +FROM gcr.io/distroless/cc-debian12:nonroot +ARG MAINTAINER="vdaas.org vald team " LABEL maintainer="${MAINTAINER}" -ENV APP_NAME ngt +ENV APP_NAME=agent COPY --from=builder /usr/bin/${APP_NAME} /usr/bin/${APP_NAME} -COPY --from=builder /tmp/config.yaml /etc/server/config.yaml - USER nonroot:nonroot - -ENTRYPOINT ["/usr/bin/ngt"] +ENTRYPOINT ["/usr/bin/agent"] \ No newline at end of file diff --git a/dockers/agent/core/faiss/Dockerfile b/dockers/agent/core/faiss/Dockerfile index 6e88b55a81b..271a8650dba 100644 --- a/dockers/agent/core/faiss/Dockerfile +++ b/dockers/agent/core/faiss/Dockerfile @@ -15,111 +15,97 @@ # limitations under the License. # -# ARG DISTROLESS_IMAGE=gcr.io/distroless/static -# ARG DISTROLESS_IMAGE_TAG=nonroot -ARG MAINTAINER="vdaas.org vald team " +# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go -FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder +ARG UPX_OPTIONS=-9 +# skipcq: DOK-DL3026 +FROM ghcr.io/vdaas/vald/vald-buildbase:nightly AS builder +ARG MAINTAINER="vdaas.org vald team " +LABEL maintainer="${MAINTAINER}" ARG TARGETARCH ARG TARGETOS ARG GO_VERSION - -ENV GO111MODULE on -ENV DEBIAN_FRONTEND noninteractive -ENV INITRD No -ENV LANG en_US.UTF-8 -ENV GOROOT /opt/go -ENV GOPATH /go -ENV PATH ${PATH}:${GOROOT}/bin:${GOPATH}/bin -ENV ORG vdaas -ENV REPO vald -ENV PKG agent/core/faiss -ENV PKG_INTERNAL agent/internal -ENV APP_NAME faiss - +ARG RUST_VERSION +ENV APP_NAME=faiss +ENV DEBIAN_FRONTEND=noninteractive +ENV GO111MODULE=on +ENV GOPATH=/go +ENV GOROOT=/opt/go +ENV HOME=/root +ENV INITRD=No +ENV LANG=en_US.UTF-8 +ENV ORG=vdaas +ENV PKG=agent/core/faiss +ENV REPO=vald +ENV PATH=${GOPATH}/bin:${GOROOT}/bin:/usr/local/bin:${PATH} + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] # skipcq: DOK-DL3008 -RUN apt-get update && apt-get install -y --no-install-recommends \ +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 \ - cmake \ curl \ + git \ + cmake \ g++ \ gcc \ - git \ - intel-mkl \ unzip \ - upx \ + liblapack-dev \ + libomp-dev \ + libopenblas-dev \ + gfortran \ && ldconfig \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && rm -rf \ + /var/lib/apt/lists/* \ + /var/cache/* \ + && apt-get autoremove -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d -COPY Makefile.d . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} COPY Makefile . COPY .git . COPY go.mod . COPY go.sum . - -RUN --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 - +COPY cmd/${PKG}/sample.yaml /tmp/config.yaml +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d +COPY Makefile.d . +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions +COPY versions . +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/pkg/agent/internal +COPY pkg/agent/internal . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/apis/grpc COPY apis/grpc . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/pkg/${PKG} COPY pkg/${PKG} . - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/pkg/${PKG_INTERNAL} -COPY pkg/${PKG_INTERNAL} . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} COPY cmd/${PKG} . -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions -COPY versions . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} -RUN update-alternatives --set libblas.so-x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libmkl_rt.so \ - && make faiss/install - +#skipcq: DOK-W1001, DOK-SC2086 RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + make GO_VERSION="${GO_VERSION}" go/install \ + && make go/download \ + && make faiss/install \ + && make GOARCH="${TARGETARCH}" GOOS="${TARGETOS}" REPO="${ORG}" NAME="${REPO}" cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} -RUN cp sample.yaml /tmp/config.yaml - -FROM --platform=${TARGETPLATFORM} ubuntu:devel +# skipcq: DOK-DL3026 +FROM gcr.io/distroless/static:nonroot +ARG MAINTAINER="vdaas.org vald team " LABEL maintainer="${MAINTAINER}" -ENV APP_NAME faiss +ENV APP_NAME=faiss -COPY --from=builder /usr/bin/${APP_NAME} /go/bin/${APP_NAME} +COPY --from=builder /usr/bin/${APP_NAME} /usr/bin/${APP_NAME} COPY --from=builder /tmp/config.yaml /etc/server/config.yaml - -COPY --from=builder /usr/local/lib/libfaiss.so /usr/local/lib/libfaiss.so -COPY --from=builder /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 -COPY --from=builder /lib/x86_64-linux-gnu/libstdc++.so.6 /lib/x86_64-linux-gnu/libstdc++.so.6 -COPY --from=builder /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib/x86_64-linux-gnu/libgcc_s.so.1 -COPY --from=builder /lib/x86_64-linux-gnu/libc.so.6 /lib/x86_64-linux-gnu/libc.so.6 -COPY --from=builder /lib/x86_64-linux-gnu/libmkl_intel_lp64.so /lib/x86_64-linux-gnu/libmkl_intel_lp64.so -COPY --from=builder /lib/x86_64-linux-gnu/libmkl_sequential.so /lib/x86_64-linux-gnu/libmkl_sequential.so -COPY --from=builder /lib/x86_64-linux-gnu/libmkl_core.so /lib/x86_64-linux-gnu/libmkl_core.so -COPY --from=builder /lib/x86_64-linux-gnu/libgomp.so.1 /lib/x86_64-linux-gnu/libgomp.so.1 -COPY --from=builder /lib/x86_64-linux-gnu/libm.so.6 /lib/x86_64-linux-gnu/libm.so.6 -COPY --from=builder /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libdl.so.2 -COPY --from=builder /lib/x86_64-linux-gnu/libpthread.so.0 /lib/x86_64-linux-gnu/libpthread.so.0 -COPY --from=builder /lib/x86_64-linux-gnu/libmkl_avx2.so /lib/x86_64-linux-gnu/libmkl_avx2.so -RUN ldconfig -v - USER nonroot:nonroot - -ENTRYPOINT ["/go/bin/faiss"] +ENTRYPOINT ["/usr/bin/faiss"] \ No newline at end of file diff --git a/dockers/agent/core/ngt/Dockerfile b/dockers/agent/core/ngt/Dockerfile index ecc852f2f27..7f87d3584bc 100644 --- a/dockers/agent/core/ngt/Dockerfile +++ b/dockers/agent/core/ngt/Dockerfile @@ -15,97 +15,96 @@ # limitations under the License. # -ARG DISTROLESS_IMAGE=gcr.io/distroless/static -ARG DISTROLESS_IMAGE_TAG=nonroot -ARG MAINTAINER="vdaas.org vald team " +# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go -FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder +ARG UPX_OPTIONS=-9 +# skipcq: DOK-DL3026 +FROM ghcr.io/vdaas/vald/vald-buildbase:nightly AS builder +ARG MAINTAINER="vdaas.org vald team " +LABEL maintainer="${MAINTAINER}" ARG TARGETARCH ARG TARGETOS ARG GO_VERSION - -ENV GO111MODULE on -ENV DEBIAN_FRONTEND noninteractive -ENV INITRD No -ENV LANG en_US.UTF-8 -ENV GOROOT /opt/go -ENV GOPATH /go -ENV PATH ${PATH}:${GOROOT}/bin:${GOPATH}/bin -ENV ORG vdaas -ENV REPO vald -ENV PKG agent/core/ngt -ENV PKG_INTERNAL agent/internal -ENV APP_NAME ngt - +ARG RUST_VERSION +ENV APP_NAME=ngt +ENV DEBIAN_FRONTEND=noninteractive +ENV GO111MODULE=on +ENV GOPATH=/go +ENV GOROOT=/opt/go +ENV HOME=/root +ENV INITRD=No +ENV LANG=en_US.UTF-8 +ENV ORG=vdaas +ENV PKG=agent/core/ngt +ENV REPO=vald +ENV PATH=${GOPATH}/bin:${GOROOT}/bin:/usr/local/bin:${PATH} + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] # skipcq: DOK-DL3008 -RUN apt-get update && apt-get install -y --no-install-recommends \ +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 \ - cmake \ curl \ + git \ + cmake \ g++ \ gcc \ - git \ + unzip \ liblapack-dev \ libomp-dev \ libopenblas-dev \ - unzip \ - upx \ && ldconfig \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && rm -rf \ + /var/lib/apt/lists/* \ + /var/cache/* \ + && apt-get autoremove -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d -COPY Makefile.d . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} COPY Makefile . COPY .git . COPY go.mod . COPY go.sum . - -RUN --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 - +COPY cmd/${PKG}/sample.yaml /tmp/config.yaml +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d +COPY Makefile.d . +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions +COPY versions . +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/pkg/agent/internal +COPY pkg/agent/internal . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/apis/grpc COPY apis/grpc . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/pkg/${PKG} COPY pkg/${PKG} . - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/pkg/${PKG_INTERNAL} -COPY pkg/${PKG_INTERNAL} . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} COPY cmd/${PKG} . -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions -COPY versions . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} -RUN make ngt/install - +#skipcq: DOK-W1001, DOK-SC2086 RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + make GO_VERSION="${GO_VERSION}" go/install \ + && make go/download \ + && make ngt/install \ + && make GOARCH="${TARGETARCH}" GOOS="${TARGETOS}" REPO="${ORG}" NAME="${REPO}" cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} -RUN cp sample.yaml /tmp/config.yaml - -FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +# skipcq: DOK-DL3026 +FROM gcr.io/distroless/static:nonroot +ARG MAINTAINER="vdaas.org vald team " LABEL maintainer="${MAINTAINER}" -ENV APP_NAME ngt +ENV APP_NAME=ngt -COPY --from=builder /usr/bin/${APP_NAME} /go/bin/${APP_NAME} +COPY --from=builder /usr/bin/${APP_NAME} /usr/bin/${APP_NAME} COPY --from=builder /tmp/config.yaml /etc/server/config.yaml - USER nonroot:nonroot - -ENTRYPOINT ["/go/bin/ngt"] +ENTRYPOINT ["/usr/bin/ngt"] \ No newline at end of file diff --git a/dockers/agent/sidecar/Dockerfile b/dockers/agent/sidecar/Dockerfile index e511fdaeefc..80cffb69ceb 100644 --- a/dockers/agent/sidecar/Dockerfile +++ b/dockers/agent/sidecar/Dockerfile @@ -15,83 +15,86 @@ # limitations under the License. # -ARG DISTROLESS_IMAGE=gcr.io/distroless/static -ARG DISTROLESS_IMAGE_TAG=nonroot -ARG MAINTAINER="vdaas.org vald team " +# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go -FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder +ARG UPX_OPTIONS=-9 +# skipcq: DOK-DL3026 +FROM ghcr.io/vdaas/vald/vald-buildbase:nightly AS builder +ARG MAINTAINER="vdaas.org vald team " +LABEL maintainer="${MAINTAINER}" -ARG GO_VERSION ARG TARGETARCH ARG TARGETOS - -ENV GO111MODULE on -ENV GOPATH /go -ENV GOROOT /opt/go -ENV DEBIAN_FRONTEND noninteractive -ENV INITRD No -ENV LANG en_US.UTF-8 -ENV ORG vdaas -ENV REPO vald -ENV APP_NAME sidecar -ENV PKG agent/sidecar -ENV PKG_INTERNAL agent/internal -ENV PATH ${PATH}:${GOROOT}/bin:${GOPATH}/bin - +ARG GO_VERSION +ARG RUST_VERSION +ENV APP_NAME=sidecar +ENV DEBIAN_FRONTEND=noninteractive +ENV GO111MODULE=on +ENV GOPATH=/go +ENV GOROOT=/opt/go +ENV HOME=/root +ENV INITRD=No +ENV LANG=en_US.UTF-8 +ENV ORG=vdaas +ENV PKG=agent/sidecar +ENV REPO=vald +ENV PATH=${GOPATH}/bin:${GOROOT}/bin:/usr/local/bin:${PATH} + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] # skipcq: DOK-DL3008 -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ +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 \ - upx \ git \ + && ldconfig \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && rm -rf \ + /var/lib/apt/lists/* \ + /var/cache/* \ + && apt-get autoremove -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d -COPY Makefile.d . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} COPY Makefile . COPY .git . COPY go.mod . COPY go.sum . - -RUN --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 - +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d +COPY Makefile.d . +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions +COPY versions . +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/pkg/agent/internal +COPY pkg/agent/internal . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/apis/grpc COPY apis/grpc . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/pkg/${PKG} COPY pkg/${PKG} . - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/pkg/${PKG_INTERNAL} -COPY pkg/${PKG_INTERNAL} . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} COPY cmd/${PKG} . -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions -COPY versions . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} +#skipcq: DOK-W1001, DOK-SC2086 RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + make GO_VERSION="${GO_VERSION}" go/install \ + && make go/download \ + && make GOARCH="${TARGETARCH}" GOOS="${TARGETOS}" REPO="${ORG}" NAME="${REPO}" cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" - -FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +# skipcq: DOK-DL3026 +FROM gcr.io/distroless/static:nonroot +ARG MAINTAINER="vdaas.org vald team " LABEL maintainer="${MAINTAINER}" -ENV APP_NAME sidecar - -COPY --from=builder /usr/bin/${APP_NAME} /go/bin/${APP_NAME} +ENV APP_NAME=sidecar +COPY --from=builder /usr/bin/${APP_NAME} /usr/bin/${APP_NAME} USER nonroot:nonroot - -ENTRYPOINT ["/go/bin/sidecar"] +ENTRYPOINT ["/usr/bin/sidecar"] \ No newline at end of file diff --git a/dockers/ci/base/Dockerfile b/dockers/ci/base/Dockerfile index 745731c716d..b2b3fcee5e1 100644 --- a/dockers/ci/base/Dockerfile +++ b/dockers/ci/base/Dockerfile @@ -15,85 +15,110 @@ # limitations under the License. # -ARG MAINTAINER="vdaas.org vald team " +# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go -FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder +ARG UPX_OPTIONS=-9 +# skipcq: DOK-DL3026 +FROM ghcr.io/vdaas/vald/vald-buildbase:nightly +ARG MAINTAINER="vdaas.org vald team " LABEL maintainer="${MAINTAINER}" -ARG GO_VERSION ARG TARGETARCH ARG TARGETOS - -ENV GO111MODULE on -ENV DEBIAN_FRONTEND noninteractive -ENV INITRD No -ENV LANG en_US.UTF-8 -ENV GOROOT /opt/go -ENV GOPATH /go -ENV PATH ${PATH}:${GOROOT}/bin:${GOPATH}/bin:/usr/local/bin - -RUN 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 +ARG GO_VERSION +ARG RUST_VERSION +ENV APP_NAME=ci-container +ENV DEBIAN_FRONTEND=noninteractive +ENV GO111MODULE=on +ENV GOPATH=/go +ENV GOROOT=/opt/go +ENV HOME=/root +ENV INITRD=No +ENV LANG=en_US.UTF-8 +ENV ORG=vdaas +ENV PKG=ci/base +ENV REPO=vald +ENV RUST_HOME=/usr/loacl/lib/rust +ENV CARGO_HOME=${RUST_HOME}/cargo +ENV RUSTUP_HOME=${RUST_HOME}/rustup +ENV PATH=${CARGO_HOME}/bin:${GOPATH}/bin:${GOROOT}/bin:${RUSTUP_HOME}/bin:/usr/local/bin:${PATH} SHELL ["/bin/bash", "-o", "pipefail", "-c"] # skipcq: DOK-DL3008 -RUN apt-get update && apt-get install -y --no-install-recommends \ +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 \ - cmake \ curl \ + git \ + cmake \ g++ \ - gawk \ gcc \ + unzip \ + liblapack-dev \ + libomp-dev \ + libopenblas-dev \ + gfortran \ + curl \ + gawk \ git \ gnupg2 \ graphviz \ jq \ libhdf5-dev \ - liblapack-dev \ - libomp-dev \ - libopenblas-dev \ + libaec-dev \ nodejs \ npm \ sed \ - unzip \ zip \ + && ldconfig \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -WORKDIR ${GOPATH}/src/github.com/vdaas/vald - -ENV ROOTDIR . + && rm -rf \ + /var/lib/apt/lists/* \ + /var/cache/* \ + && apt-get autoremove +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} COPY Makefile . -COPY Makefile.d Makefile.d -COPY apis/proto apis/proto -COPY example/client/go.mod.default example/client/go.mod.default -COPY go.mod . -COPY go.sum . -COPY hack/go.mod.default hack/go.mod.default -COPY rust rust -COPY versions versions +COPY .git . +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} +COPY . . +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} +#skipcq: DOK-W1001, DOK-SC2086 RUN --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 GOARCH=${TARGETARCH} GOOS=${TARGETOS} deps ROOTDIR=${ROOTDIR} GO_CLEAN_DEPS=false \ - && make ngt/install \ - && make faiss/install \ - && make helm/install \ + make GO_VERSION="${GO_VERSION}" go/install \ + && make go/download \ + && make RUST_VERSION="${RUST_VERSION}" rust/install \ + && 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 \ + && 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 valdcli/install \ + && make kubectl/install \ && make kubelinter/install \ - && make yq/install \ - && make tparse/install \ - && make GOARCH=${TARGETARCH} GOOS=${TARGETOS} gotestfmt/install \ - && make GOARCH=${TARGETARCH} GOOS=${TARGETOS} golangci-lint/install \ && make reviewdog/install \ - && make kubectl/install \ - && make k3d/install \ - && make buf/install \ - && make k9s/install \ - && rm -rf "${GOPATH}/src/github.com/vdaas/vald/*" + && make tparse/install \ + && make valdcli/install \ + && make yq/install \ + && make minikube/install \ + && make stern/install \ + && make telepresence/install \ + && make ngt/install \ + && make faiss/install \ + && rm -rf ${GOPATH}/src/github.com/${ORG}/${REPO}/* \ No newline at end of file diff --git a/dockers/dev/Dockerfile b/dockers/dev/Dockerfile index 3a3f2ce617f..c3ca4e49162 100644 --- a/dockers/dev/Dockerfile +++ b/dockers/dev/Dockerfile @@ -15,79 +15,113 @@ # limitations under the License. # -ARG MAINTAINER="vdaas.org vald team " +# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go +ARG UPX_OPTIONS=-9 # skipcq: DOK-DL3026 -# we should stick to official devcontainers as a base image because it is well tested to be used with the vscode devcontainer extension. -FROM --platform=${TARGETPLATFORM} mcr.microsoft.com/vscode/devcontainers/base:debian +FROM mcr.microsoft.com/vscode/devcontainers/base:debian +ARG MAINTAINER="vdaas.org vald team " LABEL maintainer="${MAINTAINER}" -ARG GO_VERSION ARG TARGETARCH ARG TARGETOS - -ENV GOROOT /opt/go -ENV GOPATH /go -ENV PATH ${PATH}:${GOROOT}/bin:${GOPATH}/bin:/usr/local/bin +ARG GO_VERSION +ARG RUST_VERSION +ENV APP_NAME=dev-container +ENV DEBIAN_FRONTEND=noninteractive +ENV GO111MODULE=on +ENV GOPATH=/go +ENV GOROOT=/opt/go +ENV HOME=/root +ENV INITRD=No +ENV LANG=en_US.UTF-8 +ENV ORG=vdaas +ENV PKG=dev +ENV REPO=vald +ENV RUST_HOME=/usr/loacl/lib/rust +ENV RUSTUP_HOME=${RUST_HOME}/rustup +ENV CARGO_HOME=${RUST_HOME}/cargo +ENV PATH=${CARGO_HOME}/bin:${GOPATH}/bin:${GOROOT}/bin:${RUSTUP_HOME}/bin:/usr/local/bin:${PATH} SHELL ["/bin/bash", "-o", "pipefail", "-c"] # skipcq: DOK-DL3008 -RUN apt-get update && apt-get install -y --no-install-recommends \ +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 \ - cmake \ curl \ + git \ + cmake \ g++ \ - gawk \ gcc \ + unzip \ + liblapack-dev \ + libomp-dev \ + libopenblas-dev \ + gfortran \ + curl \ + gawk \ git \ gnupg2 \ graphviz \ jq \ libhdf5-dev \ - liblapack-dev \ - libomp-dev \ - libopenblas-dev \ + libaec-dev \ nodejs \ npm \ sed \ - unzip \ zip \ + && ldconfig \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -WORKDIR ${GOPATH}/src/github.com/vdaas/vald + && rm -rf \ + /var/lib/apt/lists/* \ + /var/cache/* \ + && apt-get autoremove +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} COPY Makefile . -COPY Makefile.d Makefile.d -COPY versions versions -COPY rust rust -COPY hack/go.mod.default hack/go.mod.default -COPY example/client/go.mod.default example/client/go.mod.default +COPY .git . +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} +COPY . . +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} +#skipcq: DOK-W1001, DOK-SC2086 RUN --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_VERSION="${GO_VERSION}" go/install \ + && make go/download \ + && make RUST_VERSION="${RUST_VERSION}" rust/install \ && make GOARCH=${TARGETARCH} GOOS=${TARGETOS} deps GO_CLEAN_DEPS=false \ - && make ngt/install \ - && make faiss/install \ - && make helm/install \ - && make helm-docs/install \ - && make valdcli/install \ - && make yq/install \ && make GOARCH=${TARGETARCH} GOOS=${TARGETOS} golangci-lint/install \ - && make reviewdog/install \ - && make kubectl/install \ - && make k3d/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 \ && echo "installing golang vscode extension dependencies" \ + && make delve/install \ + && make gomodifytags/install \ && make gopls/install \ && make gotests/install \ - && make gomodifytags/install \ && make impl/install \ - && make delve/install \ - && make staticcheck/install + && make staticcheck/install \ + && make ngt/install \ + && make faiss/install \ + && rm -rf ${GOPATH}/src/github.com/${ORG}/${REPO}/* \ No newline at end of file diff --git a/dockers/discoverer/k8s/Dockerfile b/dockers/discoverer/k8s/Dockerfile index 70fa029a3b0..f3e733075ac 100644 --- a/dockers/discoverer/k8s/Dockerfile +++ b/dockers/discoverer/k8s/Dockerfile @@ -15,84 +15,86 @@ # limitations under the License. # -ARG DISTROLESS_IMAGE=gcr.io/distroless/static -ARG DISTROLESS_IMAGE_TAG=nonroot -ARG MAINTAINER="vdaas.org vald team " +# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go -FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder +ARG UPX_OPTIONS=-9 +# skipcq: DOK-DL3026 +FROM ghcr.io/vdaas/vald/vald-buildbase:nightly AS builder +ARG MAINTAINER="vdaas.org vald team " +LABEL maintainer="${MAINTAINER}" -ARG GO_VERSION ARG TARGETARCH ARG TARGETOS - -ENV GO111MODULE on -ENV DEBIAN_FRONTEND noninteractive -ENV INITRD No -ENV LANG en_US.UTF-8 -ENV GOROOT /opt/go -ENV GOPATH /go -ENV PATH ${PATH}:${GOROOT}/bin:${GOPATH}/bin -ENV ORG vdaas -ENV REPO vald -ENV PKG discoverer/k8s -ENV APP_NAME discoverer - - +ARG GO_VERSION +ARG RUST_VERSION +ENV APP_NAME=discoverer +ENV DEBIAN_FRONTEND=noninteractive +ENV GO111MODULE=on +ENV GOPATH=/go +ENV GOROOT=/opt/go +ENV HOME=/root +ENV INITRD=No +ENV LANG=en_US.UTF-8 +ENV ORG=vdaas +ENV PKG=discoverer/k8s +ENV REPO=vald +ENV PATH=${GOPATH}/bin:${GOROOT}/bin:/usr/local/bin:${PATH} + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] # skipcq: DOK-DL3008 -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ +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 \ - upx \ git \ + && ldconfig \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && rm -rf \ + /var/lib/apt/lists/* \ + /var/cache/* \ + && apt-get autoremove -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d -COPY Makefile.d . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} COPY Makefile . COPY .git . COPY go.mod . COPY go.sum . - -RUN --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 - +COPY cmd/${PKG}/sample.yaml /tmp/config.yaml +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d +COPY Makefile.d . +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions +COPY versions . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/apis/grpc COPY apis/grpc . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/pkg/${PKG} COPY pkg/${PKG} . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} COPY cmd/${PKG} . -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions -COPY versions . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} +#skipcq: DOK-W1001, DOK-SC2086 RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + make GO_VERSION="${GO_VERSION}" go/install \ + && make go/download \ + && make GOARCH="${TARGETARCH}" GOOS="${TARGETOS}" REPO="${ORG}" NAME="${REPO}" cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} -RUN cp sample.yaml /tmp/config.yaml - -FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +# skipcq: DOK-DL3026 +FROM gcr.io/distroless/static:nonroot +ARG MAINTAINER="vdaas.org vald team " LABEL maintainer="${MAINTAINER}" -ENV APP_NAME discoverer +ENV APP_NAME=discoverer -COPY --from=builder /usr/bin/${APP_NAME} /go/bin/${APP_NAME} +COPY --from=builder /usr/bin/${APP_NAME} /usr/bin/${APP_NAME} COPY --from=builder /tmp/config.yaml /etc/server/config.yaml - USER nonroot:nonroot - -ENTRYPOINT ["/go/bin/discoverer"] +ENTRYPOINT ["/usr/bin/discoverer"] \ No newline at end of file diff --git a/dockers/gateway/filter/Dockerfile b/dockers/gateway/filter/Dockerfile index cd9e486e46f..b73663044f6 100644 --- a/dockers/gateway/filter/Dockerfile +++ b/dockers/gateway/filter/Dockerfile @@ -15,83 +15,86 @@ # limitations under the License. # -ARG DISTROLESS_IMAGE=gcr.io/distroless/static -ARG DISTROLESS_IMAGE_TAG=nonroot -ARG MAINTAINER="vdaas.org vald team " +# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go -FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder +ARG UPX_OPTIONS=-9 +# skipcq: DOK-DL3026 +FROM ghcr.io/vdaas/vald/vald-buildbase:nightly AS builder +ARG MAINTAINER="vdaas.org vald team " +LABEL maintainer="${MAINTAINER}" -ARG GO_VERSION ARG TARGETARCH ARG TARGETOS - -ENV GO111MODULE on -ENV DEBIAN_FRONTEND noninteractive -ENV INITRD No -ENV LANG en_US.UTF-8 -ENV GOROOT /opt/go -ENV GOPATH /go -ENV PATH ${PATH}:${GOROOT}/bin:${GOPATH}/bin -ENV ORG vdaas -ENV REPO vald -ENV PKG gateway/filter -ENV APP_NAME filter - +ARG GO_VERSION +ARG RUST_VERSION +ENV APP_NAME=filter +ENV DEBIAN_FRONTEND=noninteractive +ENV GO111MODULE=on +ENV GOPATH=/go +ENV GOROOT=/opt/go +ENV HOME=/root +ENV INITRD=No +ENV LANG=en_US.UTF-8 +ENV ORG=vdaas +ENV PKG=gateway/filter +ENV REPO=vald +ENV PATH=${GOPATH}/bin:${GOROOT}/bin:/usr/local/bin:${PATH} + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] # skipcq: DOK-DL3008 -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ +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 \ - upx \ git \ + && ldconfig \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && rm -rf \ + /var/lib/apt/lists/* \ + /var/cache/* \ + && apt-get autoremove -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d -COPY Makefile.d . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} COPY Makefile . COPY .git . COPY go.mod . COPY go.sum . - -RUN --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 - +COPY cmd/${PKG}/sample.yaml /tmp/config.yaml +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d +COPY Makefile.d . +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions +COPY versions . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/apis/grpc COPY apis/grpc . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/pkg/${PKG} COPY pkg/${PKG} . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} COPY cmd/${PKG} . -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions -COPY versions . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} +#skipcq: DOK-W1001, DOK-SC2086 RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + make GO_VERSION="${GO_VERSION}" go/install \ + && make go/download \ + && make GOARCH="${TARGETARCH}" GOOS="${TARGETOS}" REPO="${ORG}" NAME="${REPO}" cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} -RUN cp sample.yaml /tmp/config.yaml - -FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +# skipcq: DOK-DL3026 +FROM gcr.io/distroless/static:nonroot +ARG MAINTAINER="vdaas.org vald team " LABEL maintainer="${MAINTAINER}" -ENV APP_NAME filter +ENV APP_NAME=filter -COPY --from=builder /usr/bin/${APP_NAME} /go/bin/${APP_NAME} +COPY --from=builder /usr/bin/${APP_NAME} /usr/bin/${APP_NAME} COPY --from=builder /tmp/config.yaml /etc/server/config.yaml - USER nonroot:nonroot - -ENTRYPOINT ["/go/bin/filter"] +ENTRYPOINT ["/usr/bin/filter"] \ No newline at end of file diff --git a/dockers/gateway/lb/Dockerfile b/dockers/gateway/lb/Dockerfile index 083dbf0c655..0068b4062b7 100644 --- a/dockers/gateway/lb/Dockerfile +++ b/dockers/gateway/lb/Dockerfile @@ -15,83 +15,86 @@ # limitations under the License. # -ARG DISTROLESS_IMAGE=gcr.io/distroless/static -ARG DISTROLESS_IMAGE_TAG=nonroot -ARG MAINTAINER="vdaas.org vald team " +# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go -FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder +ARG UPX_OPTIONS=-9 +# skipcq: DOK-DL3026 +FROM ghcr.io/vdaas/vald/vald-buildbase:nightly AS builder +ARG MAINTAINER="vdaas.org vald team " +LABEL maintainer="${MAINTAINER}" -ARG GO_VERSION ARG TARGETARCH ARG TARGETOS - -ENV GO111MODULE on -ENV DEBIAN_FRONTEND noninteractive -ENV INITRD No -ENV LANG en_US.UTF-8 -ENV GOROOT /opt/go -ENV GOPATH /go -ENV PATH ${PATH}:${GOROOT}/bin:${GOPATH}/bin -ENV ORG vdaas -ENV REPO vald -ENV PKG gateway/lb -ENV APP_NAME lb - +ARG GO_VERSION +ARG RUST_VERSION +ENV APP_NAME=lb +ENV DEBIAN_FRONTEND=noninteractive +ENV GO111MODULE=on +ENV GOPATH=/go +ENV GOROOT=/opt/go +ENV HOME=/root +ENV INITRD=No +ENV LANG=en_US.UTF-8 +ENV ORG=vdaas +ENV PKG=gateway/lb +ENV REPO=vald +ENV PATH=${GOPATH}/bin:${GOROOT}/bin:/usr/local/bin:${PATH} + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] # skipcq: DOK-DL3008 -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ +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 \ - upx \ git \ + && ldconfig \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && rm -rf \ + /var/lib/apt/lists/* \ + /var/cache/* \ + && apt-get autoremove -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d -COPY Makefile.d . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} COPY Makefile . COPY .git . COPY go.mod . COPY go.sum . - -RUN --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 - +COPY cmd/${PKG}/sample.yaml /tmp/config.yaml +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d +COPY Makefile.d . +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions +COPY versions . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/apis/grpc COPY apis/grpc . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/pkg/${PKG} COPY pkg/${PKG} . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} COPY cmd/${PKG} . -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions -COPY versions . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} +#skipcq: DOK-W1001, DOK-SC2086 RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + make GO_VERSION="${GO_VERSION}" go/install \ + && make go/download \ + && make GOARCH="${TARGETARCH}" GOOS="${TARGETOS}" REPO="${ORG}" NAME="${REPO}" cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} -RUN cp sample.yaml /tmp/config.yaml - -FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +# skipcq: DOK-DL3026 +FROM gcr.io/distroless/static:nonroot +ARG MAINTAINER="vdaas.org vald team " LABEL maintainer="${MAINTAINER}" -ENV APP_NAME lb +ENV APP_NAME=lb -COPY --from=builder /usr/bin/${APP_NAME} /go/bin/${APP_NAME} +COPY --from=builder /usr/bin/${APP_NAME} /usr/bin/${APP_NAME} COPY --from=builder /tmp/config.yaml /etc/server/config.yaml - USER nonroot:nonroot - -ENTRYPOINT ["/go/bin/lb"] +ENTRYPOINT ["/usr/bin/lb"] \ No newline at end of file diff --git a/dockers/gateway/mirror/Dockerfile b/dockers/gateway/mirror/Dockerfile index 00595781857..7f4fe7ce2af 100644 --- a/dockers/gateway/mirror/Dockerfile +++ b/dockers/gateway/mirror/Dockerfile @@ -14,79 +14,87 @@ # See the License for the specific language governing permissions and # limitations under the License. # -ARG DISTROLESS_IMAGE=gcr.io/distroless/static -ARG DISTROLESS_IMAGE_TAG=nonroot -ARG MAINTAINER="vdaas.org vald team " -FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder +# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go + +ARG UPX_OPTIONS=-9 +# skipcq: DOK-DL3026 +FROM ghcr.io/vdaas/vald/vald-buildbase:nightly AS builder +ARG MAINTAINER="vdaas.org vald team " +LABEL maintainer="${MAINTAINER}" -ARG GO_VERSION ARG TARGETARCH ARG TARGETOS - -ENV GO111MODULE on -ENV DEBIAN_FRONTEND noninteractive -ENV INITRD No -ENV LANG en_US.UTF-8 -ENV GOROOT /opt/go -ENV GOPATH /go -ENV PATH ${PATH}:${GOROOT}/bin:${GOPATH}/bin -ENV ORG vdaas -ENV REPO vald -ENV PKG gateway/mirror -ENV APP_NAME mirror - +ARG GO_VERSION +ARG RUST_VERSION +ENV APP_NAME=mirror +ENV DEBIAN_FRONTEND=noninteractive +ENV GO111MODULE=on +ENV GOPATH=/go +ENV GOROOT=/opt/go +ENV HOME=/root +ENV INITRD=No +ENV LANG=en_US.UTF-8 +ENV ORG=vdaas +ENV PKG=gateway/mirror +ENV REPO=vald +ENV PATH=${GOPATH}/bin:${GOROOT}/bin:/usr/local/bin:${PATH} + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] # skipcq: DOK-DL3008 -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ +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 \ - upx \ git \ + && ldconfig \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && rm -rf \ + /var/lib/apt/lists/* \ + /var/cache/* \ + && apt-get autoremove -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d -COPY Makefile.d . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} COPY Makefile . COPY .git . COPY go.mod . COPY go.sum . - -RUN --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 - +COPY cmd/${PKG}/sample.yaml /tmp/config.yaml +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d +COPY Makefile.d . +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions +COPY versions . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/apis/grpc COPY apis/grpc . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/pkg/${PKG} COPY pkg/${PKG} . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} COPY cmd/${PKG} . -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions -COPY versions . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} +#skipcq: DOK-W1001, DOK-SC2086 RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + make GO_VERSION="${GO_VERSION}" go/install \ + && make go/download \ + && make GOARCH="${TARGETARCH}" GOOS="${TARGETOS}" REPO="${ORG}" NAME="${REPO}" cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" +# skipcq: DOK-DL3026 +FROM gcr.io/distroless/static:nonroot +ARG MAINTAINER="vdaas.org vald team " +LABEL maintainer="${MAINTAINER}" -FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} -LABEL maintainer "${MAINTAINER}" - -ENV APP_NAME mirror - -COPY --from=builder /usr/bin/${APP_NAME} /go/bin/${APP_NAME} +ENV APP_NAME=mirror +COPY --from=builder /usr/bin/${APP_NAME} /usr/bin/${APP_NAME} +COPY --from=builder /tmp/config.yaml /etc/server/config.yaml USER nonroot:nonroot - -ENTRYPOINT ["/go/bin/mirror"] +ENTRYPOINT ["/usr/bin/mirror"] \ No newline at end of file diff --git a/dockers/index/job/correction/Dockerfile b/dockers/index/job/correction/Dockerfile index 56eb6d3bca0..cc6d8d4086e 100644 --- a/dockers/index/job/correction/Dockerfile +++ b/dockers/index/job/correction/Dockerfile @@ -15,83 +15,86 @@ # limitations under the License. # -ARG DISTROLESS_IMAGE=gcr.io/distroless/static -ARG DISTROLESS_IMAGE_TAG=nonroot -ARG MAINTAINER="vdaas.org vald team " +# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go -FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder +ARG UPX_OPTIONS=-9 +# skipcq: DOK-DL3026 +FROM ghcr.io/vdaas/vald/vald-buildbase:nightly AS builder +ARG MAINTAINER="vdaas.org vald team " +LABEL maintainer="${MAINTAINER}" -ARG GO_VERSION ARG TARGETARCH ARG TARGETOS - -ENV GO111MODULE on -ENV DEBIAN_FRONTEND noninteractive -ENV INITRD No -ENV LANG en_US.UTF-8 -ENV GOROOT /opt/go -ENV GOPATH /go -ENV PATH ${PATH}:${GOROOT}/bin:${GOPATH}/bin -ENV ORG vdaas -ENV REPO vald -ENV PKG index/job/correction -ENV APP_NAME index-correction - +ARG GO_VERSION +ARG RUST_VERSION +ENV APP_NAME=index-correction +ENV DEBIAN_FRONTEND=noninteractive +ENV GO111MODULE=on +ENV GOPATH=/go +ENV GOROOT=/opt/go +ENV HOME=/root +ENV INITRD=No +ENV LANG=en_US.UTF-8 +ENV ORG=vdaas +ENV PKG=index/job/correction +ENV REPO=vald +ENV PATH=${GOPATH}/bin:${GOROOT}/bin:/usr/local/bin:${PATH} + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] # skipcq: DOK-DL3008 -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ +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 \ - upx \ git \ + && ldconfig \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && rm -rf \ + /var/lib/apt/lists/* \ + /var/cache/* \ + && apt-get autoremove -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d -COPY Makefile.d . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} COPY Makefile . COPY .git . COPY go.mod . COPY go.sum . - -RUN --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 - +COPY cmd/${PKG}/sample.yaml /tmp/config.yaml +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d +COPY Makefile.d . +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions +COPY versions . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/apis/grpc COPY apis/grpc . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/pkg/${PKG} COPY pkg/${PKG} . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} COPY cmd/${PKG} . -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions -COPY versions . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} +#skipcq: DOK-W1001, DOK-SC2086 RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + make GO_VERSION="${GO_VERSION}" go/install \ + && make go/download \ + && make GOARCH="${TARGETARCH}" GOOS="${TARGETOS}" REPO="${ORG}" NAME="${REPO}" cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} -RUN cp sample.yaml /tmp/config.yaml - -FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +# skipcq: DOK-DL3026 +FROM gcr.io/distroless/static:nonroot +ARG MAINTAINER="vdaas.org vald team " LABEL maintainer="${MAINTAINER}" -ENV APP_NAME index-correction +ENV APP_NAME=index-correction -COPY --from=builder /usr/bin/${APP_NAME} /go/bin/${APP_NAME} +COPY --from=builder /usr/bin/${APP_NAME} /usr/bin/${APP_NAME} COPY --from=builder /tmp/config.yaml /etc/server/config.yaml - USER nonroot:nonroot - -ENTRYPOINT ["/go/bin/index-correction"] +ENTRYPOINT ["/usr/bin/index-correction"] \ No newline at end of file diff --git a/dockers/index/job/creation/Dockerfile b/dockers/index/job/creation/Dockerfile index c3d67126c41..68ed8ef4731 100644 --- a/dockers/index/job/creation/Dockerfile +++ b/dockers/index/job/creation/Dockerfile @@ -15,83 +15,86 @@ # limitations under the License. # -ARG DISTROLESS_IMAGE=gcr.io/distroless/static -ARG DISTROLESS_IMAGE_TAG=nonroot -ARG MAINTAINER="vdaas.org vald team " +# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go -FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder +ARG UPX_OPTIONS=-9 +# skipcq: DOK-DL3026 +FROM ghcr.io/vdaas/vald/vald-buildbase:nightly AS builder +ARG MAINTAINER="vdaas.org vald team " +LABEL maintainer="${MAINTAINER}" -ARG GO_VERSION ARG TARGETARCH ARG TARGETOS - -ENV GO111MODULE on -ENV DEBIAN_FRONTEND noninteractive -ENV INITRD No -ENV LANG en_US.UTF-8 -ENV GOROOT /opt/go -ENV GOPATH /go -ENV PATH ${PATH}:${GOROOT}/bin:${GOPATH}/bin -ENV ORG vdaas -ENV REPO vald -ENV PKG index/job/creation -ENV APP_NAME index-creation - +ARG GO_VERSION +ARG RUST_VERSION +ENV APP_NAME=index-creation +ENV DEBIAN_FRONTEND=noninteractive +ENV GO111MODULE=on +ENV GOPATH=/go +ENV GOROOT=/opt/go +ENV HOME=/root +ENV INITRD=No +ENV LANG=en_US.UTF-8 +ENV ORG=vdaas +ENV PKG=index/job/creation +ENV REPO=vald +ENV PATH=${GOPATH}/bin:${GOROOT}/bin:/usr/local/bin:${PATH} + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] # skipcq: DOK-DL3008 -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ +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 \ - upx \ git \ + && ldconfig \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && rm -rf \ + /var/lib/apt/lists/* \ + /var/cache/* \ + && apt-get autoremove -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d -COPY Makefile.d . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} COPY Makefile . COPY .git . COPY go.mod . COPY go.sum . - -RUN --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 - +COPY cmd/${PKG}/sample.yaml /tmp/config.yaml +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d +COPY Makefile.d . +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions +COPY versions . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/apis/grpc COPY apis/grpc . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/pkg/${PKG} COPY pkg/${PKG} . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} COPY cmd/${PKG} . -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions -COPY versions . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} +#skipcq: DOK-W1001, DOK-SC2086 RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + make GO_VERSION="${GO_VERSION}" go/install \ + && make go/download \ + && make GOARCH="${TARGETARCH}" GOOS="${TARGETOS}" REPO="${ORG}" NAME="${REPO}" cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} -RUN cp sample.yaml /tmp/config.yaml - -FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +# skipcq: DOK-DL3026 +FROM gcr.io/distroless/static:nonroot +ARG MAINTAINER="vdaas.org vald team " LABEL maintainer="${MAINTAINER}" -ENV APP_NAME index-creation +ENV APP_NAME=index-creation -COPY --from=builder /usr/bin/${APP_NAME} /go/bin/${APP_NAME} +COPY --from=builder /usr/bin/${APP_NAME} /usr/bin/${APP_NAME} COPY --from=builder /tmp/config.yaml /etc/server/config.yaml - USER nonroot:nonroot - -ENTRYPOINT ["/go/bin/index-creation"] +ENTRYPOINT ["/usr/bin/index-creation"] \ No newline at end of file diff --git a/dockers/index/job/readreplica/rotate/Dockerfile b/dockers/index/job/readreplica/rotate/Dockerfile index 41e9b8ff7fb..7a6ea13945a 100644 --- a/dockers/index/job/readreplica/rotate/Dockerfile +++ b/dockers/index/job/readreplica/rotate/Dockerfile @@ -15,83 +15,86 @@ # limitations under the License. # -ARG DISTROLESS_IMAGE=gcr.io/distroless/static -ARG DISTROLESS_IMAGE_TAG=nonroot -ARG MAINTAINER="vdaas.org vald team " +# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go -FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder +ARG UPX_OPTIONS=-9 +# skipcq: DOK-DL3026 +FROM ghcr.io/vdaas/vald/vald-buildbase:nightly AS builder +ARG MAINTAINER="vdaas.org vald team " +LABEL maintainer="${MAINTAINER}" -ARG GO_VERSION ARG TARGETARCH ARG TARGETOS - -ENV GO111MODULE on -ENV DEBIAN_FRONTEND noninteractive -ENV INITRD No -ENV LANG en_US.UTF-8 -ENV GOROOT /opt/go -ENV GOPATH /go -ENV PATH ${PATH}:${GOROOT}/bin:${GOPATH}/bin -ENV ORG vdaas -ENV REPO vald -ENV PKG index/job/readreplica/rotate -ENV APP_NAME readreplica-rotate - +ARG GO_VERSION +ARG RUST_VERSION +ENV APP_NAME=readreplica-rotate +ENV DEBIAN_FRONTEND=noninteractive +ENV GO111MODULE=on +ENV GOPATH=/go +ENV GOROOT=/opt/go +ENV HOME=/root +ENV INITRD=No +ENV LANG=en_US.UTF-8 +ENV ORG=vdaas +ENV PKG=index/job/readreplica/rotate +ENV REPO=vald +ENV PATH=${GOPATH}/bin:${GOROOT}/bin:/usr/local/bin:${PATH} + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] # skipcq: DOK-DL3008 -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ +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 \ - upx \ git \ + && ldconfig \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && rm -rf \ + /var/lib/apt/lists/* \ + /var/cache/* \ + && apt-get autoremove -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d -COPY Makefile.d . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} COPY Makefile . COPY .git . COPY go.mod . COPY go.sum . - -RUN --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 - +COPY cmd/${PKG}/sample.yaml /tmp/config.yaml +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d +COPY Makefile.d . +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions +COPY versions . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/apis/grpc COPY apis/grpc . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/pkg/${PKG} COPY pkg/${PKG} . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} COPY cmd/${PKG} . -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions -COPY versions . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} +#skipcq: DOK-W1001, DOK-SC2086 RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + make GO_VERSION="${GO_VERSION}" go/install \ + && make go/download \ + && make GOARCH="${TARGETARCH}" GOOS="${TARGETOS}" REPO="${ORG}" NAME="${REPO}" cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} -RUN cp sample.yaml /tmp/config.yaml - -FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +# skipcq: DOK-DL3026 +FROM gcr.io/distroless/static:nonroot +ARG MAINTAINER="vdaas.org vald team " LABEL maintainer="${MAINTAINER}" -ENV APP_NAME readreplica-rotate +ENV APP_NAME=readreplica-rotate -COPY --from=builder /usr/bin/${APP_NAME} /go/bin/${APP_NAME} +COPY --from=builder /usr/bin/${APP_NAME} /usr/bin/${APP_NAME} COPY --from=builder /tmp/config.yaml /etc/server/config.yaml - USER nonroot:nonroot - -ENTRYPOINT ["/go/bin/readreplica-rotate"] +ENTRYPOINT ["/usr/bin/readreplica-rotate"] \ No newline at end of file diff --git a/dockers/index/job/save/Dockerfile b/dockers/index/job/save/Dockerfile index 057c94d209b..d4777fe87c7 100644 --- a/dockers/index/job/save/Dockerfile +++ b/dockers/index/job/save/Dockerfile @@ -15,83 +15,86 @@ # limitations under the License. # -ARG DISTROLESS_IMAGE=gcr.io/distroless/static -ARG DISTROLESS_IMAGE_TAG=nonroot -ARG MAINTAINER="vdaas.org vald team " +# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go -FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder +ARG UPX_OPTIONS=-9 +# skipcq: DOK-DL3026 +FROM ghcr.io/vdaas/vald/vald-buildbase:nightly AS builder +ARG MAINTAINER="vdaas.org vald team " +LABEL maintainer="${MAINTAINER}" -ARG GO_VERSION ARG TARGETARCH ARG TARGETOS - -ENV GO111MODULE on -ENV DEBIAN_FRONTEND noninteractive -ENV INITRD No -ENV LANG en_US.UTF-8 -ENV GOROOT /opt/go -ENV GOPATH /go -ENV PATH ${PATH}:${GOROOT}/bin:${GOPATH}/bin -ENV ORG vdaas -ENV REPO vald -ENV PKG index/job/save -ENV APP_NAME index-save - +ARG GO_VERSION +ARG RUST_VERSION +ENV APP_NAME=index-save +ENV DEBIAN_FRONTEND=noninteractive +ENV GO111MODULE=on +ENV GOPATH=/go +ENV GOROOT=/opt/go +ENV HOME=/root +ENV INITRD=No +ENV LANG=en_US.UTF-8 +ENV ORG=vdaas +ENV PKG=index/job/save +ENV REPO=vald +ENV PATH=${GOPATH}/bin:${GOROOT}/bin:/usr/local/bin:${PATH} + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] # skipcq: DOK-DL3008 -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ +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 \ - upx \ git \ + && ldconfig \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && rm -rf \ + /var/lib/apt/lists/* \ + /var/cache/* \ + && apt-get autoremove -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d -COPY Makefile.d . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} COPY Makefile . COPY .git . COPY go.mod . COPY go.sum . - -RUN --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 - +COPY cmd/${PKG}/sample.yaml /tmp/config.yaml +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d +COPY Makefile.d . +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions +COPY versions . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/apis/grpc COPY apis/grpc . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/pkg/${PKG} COPY pkg/${PKG} . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} COPY cmd/${PKG} . -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions -COPY versions . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} +#skipcq: DOK-W1001, DOK-SC2086 RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + make GO_VERSION="${GO_VERSION}" go/install \ + && make go/download \ + && make GOARCH="${TARGETARCH}" GOOS="${TARGETOS}" REPO="${ORG}" NAME="${REPO}" cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} -RUN cp sample.yaml /tmp/config.yaml - -FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +# skipcq: DOK-DL3026 +FROM gcr.io/distroless/static:nonroot +ARG MAINTAINER="vdaas.org vald team " LABEL maintainer="${MAINTAINER}" -ENV APP_NAME index-save +ENV APP_NAME=index-save -COPY --from=builder /usr/bin/${APP_NAME} /go/bin/${APP_NAME} +COPY --from=builder /usr/bin/${APP_NAME} /usr/bin/${APP_NAME} COPY --from=builder /tmp/config.yaml /etc/server/config.yaml - USER nonroot:nonroot - -ENTRYPOINT ["/go/bin/index-save"] +ENTRYPOINT ["/usr/bin/index-save"] \ No newline at end of file diff --git a/dockers/index/operator/Dockerfile b/dockers/index/operator/Dockerfile index ab3a2d4a5c3..af2707e9318 100644 --- a/dockers/index/operator/Dockerfile +++ b/dockers/index/operator/Dockerfile @@ -15,84 +15,86 @@ # limitations under the License. # -ARG DISTROLESS_IMAGE=gcr.io/distroless/static -ARG DISTROLESS_IMAGE_TAG=nonroot -ARG MAINTAINER="vdaas.org vald team " +# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go -FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder +ARG UPX_OPTIONS=-9 +# skipcq: DOK-DL3026 +FROM ghcr.io/vdaas/vald/vald-buildbase:nightly AS builder +ARG MAINTAINER="vdaas.org vald team " +LABEL maintainer="${MAINTAINER}" -ARG GO_VERSION ARG TARGETARCH ARG TARGETOS - -ENV GO111MODULE on -ENV DEBIAN_FRONTEND noninteractive -ENV INITRD No -ENV LANG en_US.UTF-8 -ENV GOROOT /opt/go -ENV GOPATH /go -ENV PATH ${PATH}:${GOROOT}/bin:${GOPATH}/bin -ENV ORG vdaas -ENV REPO vald -ENV PKG index/operator -ENV APP_NAME index-operator - - +ARG GO_VERSION +ARG RUST_VERSION +ENV APP_NAME=index-operator +ENV DEBIAN_FRONTEND=noninteractive +ENV GO111MODULE=on +ENV GOPATH=/go +ENV GOROOT=/opt/go +ENV HOME=/root +ENV INITRD=No +ENV LANG=en_US.UTF-8 +ENV ORG=vdaas +ENV PKG=index/operator +ENV REPO=vald +ENV PATH=${GOPATH}/bin:${GOROOT}/bin:/usr/local/bin:${PATH} + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] # skipcq: DOK-DL3008 -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ +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 \ - upx \ git \ + && ldconfig \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && rm -rf \ + /var/lib/apt/lists/* \ + /var/cache/* \ + && apt-get autoremove -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d -COPY Makefile.d . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} COPY Makefile . COPY .git . COPY go.mod . COPY go.sum . - -RUN --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 - +COPY cmd/${PKG}/sample.yaml /tmp/config.yaml +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d +COPY Makefile.d . +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions +COPY versions . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/apis/grpc COPY apis/grpc . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/pkg/${PKG} COPY pkg/${PKG} . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} COPY cmd/${PKG} . -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions -COPY versions . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} +#skipcq: DOK-W1001, DOK-SC2086 RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + make GO_VERSION="${GO_VERSION}" go/install \ + && make go/download \ + && make GOARCH="${TARGETARCH}" GOOS="${TARGETOS}" REPO="${ORG}" NAME="${REPO}" cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} -RUN cp sample.yaml /tmp/config.yaml - -FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +# skipcq: DOK-DL3026 +FROM gcr.io/distroless/static:nonroot +ARG MAINTAINER="vdaas.org vald team " LABEL maintainer="${MAINTAINER}" -ENV APP_NAME index-operator +ENV APP_NAME=index-operator -COPY --from=builder /usr/bin/${APP_NAME} /go/bin/${APP_NAME} +COPY --from=builder /usr/bin/${APP_NAME} /usr/bin/${APP_NAME} COPY --from=builder /tmp/config.yaml /etc/server/config.yaml - USER nonroot:nonroot - -ENTRYPOINT ["/go/bin/index-operator"] +ENTRYPOINT ["/usr/bin/index-operator"] \ No newline at end of file diff --git a/dockers/manager/index/Dockerfile b/dockers/manager/index/Dockerfile index ced3126419e..ba430451d40 100644 --- a/dockers/manager/index/Dockerfile +++ b/dockers/manager/index/Dockerfile @@ -15,83 +15,86 @@ # limitations under the License. # -ARG DISTROLESS_IMAGE=gcr.io/distroless/static -ARG DISTROLESS_IMAGE_TAG=nonroot -ARG MAINTAINER="vdaas.org vald team " +# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go -FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder +ARG UPX_OPTIONS=-9 +# skipcq: DOK-DL3026 +FROM ghcr.io/vdaas/vald/vald-buildbase:nightly AS builder +ARG MAINTAINER="vdaas.org vald team " +LABEL maintainer="${MAINTAINER}" -ARG GO_VERSION ARG TARGETARCH ARG TARGETOS - -ENV GO111MODULE on -ENV DEBIAN_FRONTEND noninteractive -ENV INITRD No -ENV LANG en_US.UTF-8 -ENV GOROOT /opt/go -ENV GOPATH /go -ENV PATH ${PATH}:${GOROOT}/bin:${GOPATH}/bin -ENV ORG vdaas -ENV REPO vald -ENV PKG manager/index -ENV APP_NAME index - +ARG GO_VERSION +ARG RUST_VERSION +ENV APP_NAME=index +ENV DEBIAN_FRONTEND=noninteractive +ENV GO111MODULE=on +ENV GOPATH=/go +ENV GOROOT=/opt/go +ENV HOME=/root +ENV INITRD=No +ENV LANG=en_US.UTF-8 +ENV ORG=vdaas +ENV PKG=manager/index +ENV REPO=vald +ENV PATH=${GOPATH}/bin:${GOROOT}/bin:/usr/local/bin:${PATH} + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] # skipcq: DOK-DL3008 -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ +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 \ - upx \ git \ + && ldconfig \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && rm -rf \ + /var/lib/apt/lists/* \ + /var/cache/* \ + && apt-get autoremove -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d -COPY Makefile.d . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} COPY Makefile . COPY .git . COPY go.mod . COPY go.sum . - -RUN --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 - +COPY cmd/${PKG}/sample.yaml /tmp/config.yaml +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d +COPY Makefile.d . +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions +COPY versions . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/apis/grpc COPY apis/grpc . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/pkg/${PKG} COPY pkg/${PKG} . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} COPY cmd/${PKG} . -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions -COPY versions . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} +#skipcq: DOK-W1001, DOK-SC2086 RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + make GO_VERSION="${GO_VERSION}" go/install \ + && make go/download \ + && make GOARCH="${TARGETARCH}" GOOS="${TARGETOS}" REPO="${ORG}" NAME="${REPO}" cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} -RUN cp sample.yaml /tmp/config.yaml - -FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +# skipcq: DOK-DL3026 +FROM gcr.io/distroless/static:nonroot +ARG MAINTAINER="vdaas.org vald team " LABEL maintainer="${MAINTAINER}" -ENV APP_NAME index +ENV APP_NAME=index -COPY --from=builder /usr/bin/${APP_NAME} /go/bin/${APP_NAME} +COPY --from=builder /usr/bin/${APP_NAME} /usr/bin/${APP_NAME} COPY --from=builder /tmp/config.yaml /etc/server/config.yaml - USER nonroot:nonroot - -ENTRYPOINT ["/go/bin/index"] +ENTRYPOINT ["/usr/bin/index"] \ No newline at end of file diff --git a/dockers/operator/helm/Dockerfile b/dockers/operator/helm/Dockerfile index 3fffbf842ae..8376200e06d 100644 --- a/dockers/operator/helm/Dockerfile +++ b/dockers/operator/helm/Dockerfile @@ -14,41 +14,36 @@ # See the License for the specific language governing permissions and # limitations under the License. # -ARG DISTROLESS_IMAGE=gcr.io/distroless/static -ARG DISTROLESS_IMAGE_TAG=nonroot -ARG OPERATOR_SDK_VERSION -ARG UPX_OPTIONS=-9 -ARG VERSION="v1" -ARG GROUP="vald.vdaas.org" -ARG VALD_KIND="ValdRelease" -ARG VALD_HELM_OPERATOR_KIND="ValdHelmOperatorRelease" -ARG MAINTAINER="vdaas.org vald team " +# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go + +ARG UPX_OPTIONS=-9 +ARG OPERATOR_SDK_VERSION=latest +# skipcq: DOK-DL3026 +FROM quay.io/operator-framework/helm-operator:${OPERATOR_SDK_VERSION} AS operator # skipcq: DOK-DL3026 -FROM --platform=${TARGETPLATFORM} quay.io/operator-framework/helm-operator:${OPERATOR_SDK_VERSION} AS operator -FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder +FROM ghcr.io/vdaas/vald/vald-buildbase:nightly AS builder +ARG MAINTAINER="vdaas.org vald team " +LABEL maintainer="${MAINTAINER}" -ARG GO_VERSION -ARG OPERATOR_SDK_VERSION -ARG VERSION -ARG GROUP -ARG VALD_KIND -ARG VALD_HELM_OPERATOR_KIND -ARG UPX_OPTIONS ARG TARGETARCH ARG TARGETOS - -ENV GO111MODULE on -ENV DEBIAN_FRONTEND noninteractive -ENV INITRD No -ENV LANG en_US.UTF-8 -ENV GOROOT /opt/go -ENV GOPATH /go -ENV PATH ${PATH}:${GOROOT}/bin:${GOPATH}/bin -ENV ORG vdaas -ENV REPO vald -ENV APP_NAME helm-operator - +ARG GO_VERSION +ARG RUST_VERSION +ENV APP_NAME=helm-operator +ENV DEBIAN_FRONTEND=noninteractive +ENV GO111MODULE=on +ENV GOPATH=/go +ENV GOROOT=/opt/go +ENV HOME=/root +ENV INITRD=No +ENV LANG=en_US.UTF-8 +ENV ORG=vdaas +ENV PKG=operator/helm +ENV REPO=vald +ENV PATH=${GOPATH}/bin:${GOROOT}/bin:/usr/local/bin:${PATH} + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] # skipcq: DOK-DL3008 RUN apt-get clean \ && rm -rf \ @@ -57,11 +52,11 @@ RUN apt-get clean \ && apt-get update -y \ && apt-get upgrade -y \ && apt-get install -y --no-install-recommends --fix-missing \ - ca-certificates \ build-essential \ + ca-certificates \ curl \ - upx \ git \ + upx \ && ldconfig \ && apt-get clean \ && rm -rf \ @@ -69,75 +64,55 @@ RUN apt-get clean \ /var/cache/* \ && apt-get autoremove -RUN { \ - echo "---"; \ - echo "- version: ${VERSION}"; \ - echo " group: ${GROUP}"; \ - echo " kind: ${VALD_KIND}"; \ - echo " chart: helm-charts/vald"; \ - echo "- version: ${VERSION}"; \ - echo " group: ${GROUP}"; \ - echo " kind: ${VALD_HELM_OPERATOR_KIND}"; \ - echo " chart: helm-charts/vald-helm-operator"; \ - } > /tmp/watches.yaml - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d -COPY Makefile.d . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} COPY Makefile . COPY .git . COPY go.mod . COPY go.sum . - -RUN make GO_VERSION=${GO_VERSION} go/install \ - && make go/download - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal/errors -COPY internal/errors . - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal/log -COPY internal/log . - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal/conv -COPY internal/conv . - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal/sync -COPY internal/sync . - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal/strings -COPY internal/strings . - +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d +COPY Makefile.d . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions COPY versions . - +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal +COPY internal . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/charts COPY charts . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/hack COPY hack . +COPY --from=operator /usr/local/bin/${APP_NAME} /usr/bin/${APP_NAME} WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} -RUN make GOARCH=${TARGETARCH} GOOS=${TARGETOS} helm/schema/vald \ +#skipcq: DOK-W1001, DOK-SC2086 +RUN --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 \ + && mkdir -p /opt/helm/charts \ + && { \ + echo "---"; \ + echo "- version: v1"; \ + echo " group: vald.vdaas.org"; \ + echo " kind: ValdRelease"; \ + echo " chart: /opt/helm/charts/vald"; \ + echo "- version: v1"; \ + echo " group: vald.vdaas.org"; \ + echo " kind: ValdHelmOperatorRelease"; \ + echo " chart: /opt/helm/charts/vald-helm-operator"; \ + } > /opt/helm/watches.yaml \ + && make GOARCH=${TARGETARCH} GOOS=${TARGETOS} helm/schema/vald \ && make GOARCH=${TARGETARCH} GOOS=${TARGETOS} helm/schema/vald-helm-operator \ - && cp -r charts /charts - -COPY --from=operator /usr/local/bin/${APP_NAME} /usr/bin/${APP_NAME} - -RUN upx ${UPX_OPTIONS} "/usr/bin/${APP_NAME}" - -FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} + && cp -r charts/* /opt/helm/charts/ \ + && upx "/usr/bin/${APP_NAME}" +# skipcq: DOK-DL3026 +FROM gcr.io/distroless/static:nonroot +ARG MAINTAINER="vdaas.org vald team " LABEL maintainer="${MAINTAINER}" -ENV APP_NAME helm-operator - -ENV HOME=/opt/helm -WORKDIR ${HOME} +ENV APP_NAME=helm-operator -COPY --from=builder /tmp/watches.yaml watches.yaml -COPY --from=builder /charts/vald helm-charts/vald -COPY --from=builder /charts/vald-helm-operator helm-charts/vald-helm-operator COPY --from=builder /usr/bin/${APP_NAME} /usr/bin/${APP_NAME} - +COPY --from=builder /opt/helm/watches.yaml /opt/helm/watches.yaml +COPY --from=builder /opt/helm/charts/vald /opt/helm/charts/vald +COPY --from=builder /opt/helm/charts/vald-helm-operator /opt/helm/charts/vald-helm-operator USER nonroot:nonroot - -ENTRYPOINT ["/usr/bin/helm-operator", "run", "--watches-file=./watches.yaml"] +ENTRYPOINT ["/usr/bin/helm-operator", "run", "--watches-file=/opt/helm/watches.yaml"] \ No newline at end of file diff --git a/dockers/readreplica/job/readreplica/rotate/Dockerfile b/dockers/readreplica/job/readreplica/rotate/Dockerfile new file mode 100644 index 00000000000..f04b8fd16f5 --- /dev/null +++ b/dockers/readreplica/job/readreplica/rotate/Dockerfile @@ -0,0 +1,110 @@ +# syntax = docker/dockerfile:latest +# +# 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. +# + +# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go + +ARG RUNTIME_IMAGE=gcr.io/distroless/static +ARG RUNTIME_IMAGE_TAG=nonroot +ARG UPX_OPTIONS=-9 +ARG MAINTAINER="vdaas.org vald team " + +FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder +LABEL maintainer="${MAINTAINER}" + +ARG TARGETARCH +ARG TARGETOS +ARG GO_VERSION + +ENV GO111MODULE=on +ENV DEBIAN_FRONTEND=noninteractive +ENV INITRD=No +ENV LANG=en_US.UTF-8 +ENV GOROOT=/opt/go +ENV GOPATH=/go +ENV PATH=${PATH}:${GOROOT}/bin:${GOPATH}/bin:/usr/local/bin +ENV ORG=vdaas +ENV REPO=vald +ENV PKG=readreplica/job/readreplica/rotate + +ENV APP_NAME=readreplica-rotate + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +# skipcq: DOK-DL3008 +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential \ + ca-certificates \ + cmake \ + curl \ + g++ \ + gcc \ + git \ + unzip \ + upx \ + && ldconfig \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d +COPY Makefile.d . +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} +COPY Makefile . +COPY .git . +COPY go.mod . +COPY go.sum . + +RUN --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 + +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal +COPY internal . + +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/apis/grpc +COPY apis/grpc . + +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/pkg/${PKG} +COPY pkg/${PKG} . + +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} +COPY cmd/${PKG} . + +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions +COPY versions . + +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} + +RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ + --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" + +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} +RUN cp sample.yaml /tmp/config.yaml + +FROM --platform=${TARGETPLATFORM} ${RUNTIME_IMAGE}:${RUNTIME_IMAGE_TAG} +ARG MAINTAINER="vdaas.org vald team " +LABEL maintainer="${MAINTAINER}" + +ENV APP_NAME=readreplica-rotate + +COPY --from=builder /usr/bin/${APP_NAME} /go/bin/${APP_NAME} +COPY --from=builder /tmp/config.yaml /etc/server/config.yaml + +USER nonroot:nonroot + +ENTRYPOINT ["/go/bin/readreplica-rotate"] diff --git a/dockers/tools/benchmark/job/Dockerfile b/dockers/tools/benchmark/job/Dockerfile index d7ce37b64f0..7d59975beff 100644 --- a/dockers/tools/benchmark/job/Dockerfile +++ b/dockers/tools/benchmark/job/Dockerfile @@ -15,113 +15,93 @@ # limitations under the License. # -ARG ZLIB_VERSION -ARG HDF5_VERSION -ARG DISTROLESS_IMAGE=gcr.io/distroless/static -ARG DISTROLESS_IMAGE_TAG=nonroot +# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go + ARG UPX_OPTIONS=-9 +# skipcq: DOK-DL3026 +FROM ghcr.io/vdaas/vald/vald-buildbase:nightly AS builder ARG MAINTAINER="vdaas.org vald team " +LABEL maintainer="${MAINTAINER}" -FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder - -ARG GO_VERSION -ARG UPX_OPTIONS -ARG ZLIB_VERSION -ARG HDF5_VERSION ARG TARGETARCH ARG TARGETOS - -ENV GO111MODULE on -ENV DEBIAN_FRONTEND noninteractive -ENV INITRD No -ENV LANG en_US.UTF-8 -ENV GOROOT /opt/go -ENV GOPATH /go -ENV PATH ${PATH}:${GOROOT}/bin:${GOPATH}/bin -ENV ORG vdaas -ENV REPO vald -ENV APP_NAME job -ENV PKG tools/benchmark/${APP_NAME} -ENV BUILD_DIR=/usr/local -ENV LIB_DIR=/usr/local/lib -ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${LIB_DIR}:/lib - -# skipcq: DOK-DL3008, DOK-DL3003 -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ +ARG GO_VERSION +ARG RUST_VERSION +ENV APP_NAME=job +ENV DEBIAN_FRONTEND=noninteractive +ENV GO111MODULE=on +ENV GOPATH=/go +ENV GOROOT=/opt/go +ENV HOME=/root +ENV INITRD=No +ENV LANG=en_US.UTF-8 +ENV ORG=vdaas +ENV PKG=tools/benchmark/job +ENV REPO=vald +ENV PATH=${GOPATH}/bin:${GOROOT}/bin:/usr/local/bin:${PATH} + +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 \ - upx \ - g++ \ git \ + cmake \ + g++ \ + gcc \ + unzip \ + libhdf5-dev \ + libaec-dev \ && ldconfig \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* \ - && mkdir -p ${LIB_DIR} \ - && curl -fsSLO https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz \ - && mkdir -p zlib \ - && tar -xzvf zlib-${ZLIB_VERSION}.tar.gz -C zlib --strip-components 1 \ - && cd zlib \ - && ./configure --prefix=${LIB_DIR} --static \ - && make \ - && make test \ - && make install \ - && cd / \ - && mkdir -p hdf5 \ - && curl -fsSLO https://github.com/HDFGroup/hdf5/releases/download/${HDF5_VERSION}/${HDF5_VERSION}.tar.gz \ - && tar -xzvf ${HDF5_VERSION}.tar.gz -C hdf5 --strip-components 2 \ - && cd hdf5 \ - && ./configure --enable-build-mode=production --enable-static-exec --disable-shared --prefix=${BUILD_DIR} --with-zlib=${BUILD_DIR}/include,${LIB_DIR} LDFLAGS="-Wl,-rpath,${LIB_DIR}" \ - && make check \ - && make install \ - && ldconfig - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d -COPY Makefile.d . + && rm -rf \ + /var/lib/apt/lists/* \ + /var/cache/* \ + && apt-get autoremove WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} COPY Makefile . COPY .git . COPY go.mod . COPY go.sum . - -RUN --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 - +COPY cmd/${PKG}/sample.yaml /tmp/config.yaml +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d +COPY Makefile.d . +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions +COPY versions . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/apis/grpc COPY apis/grpc . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/pkg/${PKG} COPY pkg/${PKG} . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} COPY cmd/${PKG} . -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions -COPY versions . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} +#skipcq: DOK-W1001, DOK-SC2086 RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + make GO_VERSION="${GO_VERSION}" go/install \ + && make go/download \ + && make hdf5/install \ + && make GOARCH="${TARGETARCH}" GOOS="${TARGETOS}" REPO="${ORG}" NAME="${REPO}" cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} -RUN cp sample.yaml /tmp/config.yaml - -FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +# skipcq: DOK-DL3026 +FROM gcr.io/distroless/static:nonroot +ARG MAINTAINER="vdaas.org vald team " LABEL maintainer="${MAINTAINER}" -ENV APP_NAME job +ENV APP_NAME=job -COPY --from=builder /usr/bin/${APP_NAME} /go/bin/${APP_NAME} +COPY --from=builder /usr/bin/${APP_NAME} /usr/bin/${APP_NAME} COPY --from=builder /tmp/config.yaml /etc/server/config.yaml - USER nonroot:nonroot - -ENTRYPOINT ["/go/bin/job"] +ENTRYPOINT ["/usr/bin/job"] \ No newline at end of file diff --git a/dockers/tools/benchmark/operator/Dockerfile b/dockers/tools/benchmark/operator/Dockerfile index 123fe81ae29..34f32139979 100644 --- a/dockers/tools/benchmark/operator/Dockerfile +++ b/dockers/tools/benchmark/operator/Dockerfile @@ -15,85 +15,86 @@ # limitations under the License. # -ARG DISTROLESS_IMAGE=gcr.io/distroless/static -ARG DISTROLESS_IMAGE_TAG=nonroot +# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go + ARG UPX_OPTIONS=-9 +# skipcq: DOK-DL3026 +FROM ghcr.io/vdaas/vald/vald-buildbase:nightly AS builder ARG MAINTAINER="vdaas.org vald team " +LABEL maintainer="${MAINTAINER}" -FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder - -ARG GO_VERSION ARG TARGETARCH ARG TARGETOS - -ENV GO111MODULE on -ENV DEBIAN_FRONTEND noninteractive -ENV INITRD No -ENV LANG en_US.UTF-8 -ENV GOROOT /opt/go -ENV GOPATH /go -ENV PATH ${PATH}:${GOROOT}/bin:${GOPATH}/bin -# ARG UPX_OPTIONS -ENV ORG vdaas -ENV REPO vald -ENV APP_NAME operator -ENV PKG tools/benchmark/${APP_NAME} - +ARG GO_VERSION +ARG RUST_VERSION +ENV APP_NAME=operator +ENV DEBIAN_FRONTEND=noninteractive +ENV GO111MODULE=on +ENV GOPATH=/go +ENV GOROOT=/opt/go +ENV HOME=/root +ENV INITRD=No +ENV LANG=en_US.UTF-8 +ENV ORG=vdaas +ENV PKG=tools/benchmark/operator +ENV REPO=vald +ENV PATH=${GOPATH}/bin:${GOROOT}/bin:/usr/local/bin:${PATH} + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] # skipcq: DOK-DL3008 -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ +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 \ - upx \ git \ + && ldconfig \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d -COPY Makefile.d . + && rm -rf \ + /var/lib/apt/lists/* \ + /var/cache/* \ + && apt-get autoremove WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} COPY Makefile . COPY .git . COPY go.mod . COPY go.sum . - -RUN --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 - +COPY cmd/${PKG}/sample.yaml /tmp/config.yaml +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d +COPY Makefile.d . +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions +COPY versions . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/apis/grpc COPY apis/grpc . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/pkg/${PKG} COPY pkg/${PKG} . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} COPY cmd/${PKG} . -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions -COPY versions . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} +#skipcq: DOK-W1001, DOK-SC2086 RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + make GO_VERSION="${GO_VERSION}" go/install \ + && make go/download \ + && make GOARCH="${TARGETARCH}" GOOS="${TARGETOS}" REPO="${ORG}" NAME="${REPO}" cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" - -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} -RUN cp sample.yaml /tmp/config.yaml - -FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +# skipcq: DOK-DL3026 +FROM gcr.io/distroless/static:nonroot +ARG MAINTAINER="vdaas.org vald team " LABEL maintainer="${MAINTAINER}" -ENV APP_NAME operator -COPY --from=builder /usr/bin/${APP_NAME} /go/bin/${APP_NAME} -COPY --from=builder /tmp/config.yaml /etc/server/config.yaml +ENV APP_NAME=operator +COPY --from=builder /usr/bin/${APP_NAME} /usr/bin/${APP_NAME} +COPY --from=builder /tmp/config.yaml /etc/server/config.yaml USER nonroot:nonroot - -ENTRYPOINT ["/go/bin/operator"] +ENTRYPOINT ["/usr/bin/operator"] \ No newline at end of file diff --git a/dockers/tools/cli/loadtest/Dockerfile b/dockers/tools/cli/loadtest/Dockerfile index ffafc92b4d1..e34260f785b 100644 --- a/dockers/tools/cli/loadtest/Dockerfile +++ b/dockers/tools/cli/loadtest/Dockerfile @@ -15,116 +15,95 @@ # limitations under the License. # -ARG MAINTAINER="vdaas.org vald team " +# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go -FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder +ARG UPX_OPTIONS=-9 +# skipcq: DOK-DL3026 +FROM ghcr.io/vdaas/vald/vald-buildbase:nightly AS builder +ARG MAINTAINER="vdaas.org vald team " +LABEL maintainer="${MAINTAINER}" -ARG GO_VERSION ARG TARGETARCH ARG TARGETOS +ARG GO_VERSION +ARG RUST_VERSION +ENV APP_NAME=loadtest +ENV DEBIAN_FRONTEND=noninteractive +ENV GO111MODULE=on +ENV GOPATH=/go +ENV GOROOT=/opt/go +ENV HOME=/root +ENV INITRD=No +ENV LANG=en_US.UTF-8 +ENV ORG=vdaas +ENV PKG=tools/cli/loadtest +ENV REPO=vald +ENV PATH=${GOPATH}/bin:${GOROOT}/bin:/usr/local/bin:${PATH} -ENV GO111MODULE on -ENV DEBIAN_FRONTEND noninteractive -ENV INITRD No -ENV LANG en_US.UTF-8 -ENV GOROOT /opt/go -ENV GOPATH /go -ENV PATH ${PATH}:${GOROOT}/bin:${GOPATH}/bin -ENV ORG vdaas -ENV REPO vald -ENV APP_NAME loadtest -ENV PKG tools/cli/${APP_NAME} - +SHELL ["/bin/bash", "-o", "pipefail", "-c"] # skipcq: DOK-DL3008 -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ +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 \ - upx \ git \ + cmake \ + g++ \ + gcc \ + unzip \ libhdf5-dev \ + libaec-dev \ && ldconfig \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && rm -rf \ + /var/lib/apt/lists/* \ + /var/cache/* \ + && apt-get autoremove -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d -COPY Makefile.d . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} COPY Makefile . COPY .git . COPY go.mod . COPY go.sum . - -RUN --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 - +COPY cmd/${PKG}/sample.yaml /tmp/config.yaml +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d +COPY Makefile.d . +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions +COPY versions . +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/hack/benchmark/assets/x1b +COPY hack/benchmark/assets/x1b . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/apis/grpc COPY apis/grpc . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/pkg/${PKG} COPY pkg/${PKG} . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} COPY cmd/${PKG} . -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/hack/benchmark/assets/x1b -COPY hack/benchmark/assets/x1b . - WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} -COPY versions/GO_VERSION . -COPY versions/VALD_VERSION . -COPY .git . -SHELL ["/bin/bash", "-o", "pipefail", "-c"] -RUN GO_VERSION="$(< GO_VERSION)" \ - && VALD_VERSION="$(< VALD_VERSION)" \ - && GIT_COMMIT="$(git rev-list -1 HEAD)" \ - && CPU_INFO_FLAGS="$(< /proc/cpuinfo | grep flags | cut -d " " -f 2- | head -1 || true)" \ - && GOOS="$(go env GOOS)" \ - && GOARCH="$(go env GOARCH)" \ - && CGO_ENABLED=1 \ - && CGO_CXXFLAGS="-g -Ofast -march=native" \ - CGO_FFLAGS="-g -Ofast -march=native" \ - CGO_LDFLAGS="-g -Ofast -march=native" \ - GO111MODULE=on \ - go build \ - --ldflags "-s -w \ - -X 'github.com/${ORG}/${REPO}/internal/info.Version=${VALD_VERSION}' \ - -X 'github.com/${ORG}/${REPO}/internal/info.GitCommit=${GIT_COMMIT}' \ - -X 'github.com/${ORG}/${REPO}/internal/info.GoVersion=${GO_VERSION}' \ - -X 'github.com/${ORG}/${REPO}/internal/info.GoOS=${GOOS}' \ - -X 'github.com/${ORG}/${REPO}/internal/info.GoArch=${GOARCH}' \ - -X 'github.com/${ORG}/${REPO}/internal/info.CGOEnabled=${CGO_ENABLED}' \ - -X 'github.com/${ORG}/${REPO}/internal/info.BuildCPUInfoFlags=${CPU_INFO_FLAGS}'" \ - -a \ - -tags "cgo netgo" \ - -trimpath \ - -installsuffix "cgo netgo" \ - -o "${APP_NAME}" \ - "cmd/${PKG}/main.go" \ - && upx -9 -o "/usr/bin/${APP_NAME}" "${APP_NAME}" - -# Start From Scratch For Running Environment -FROM --platform=${TARGETPLATFORM} ubuntu:devel +#skipcq: DOK-W1001, DOK-SC2086 +RUN --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 \ + && make hdf5/install \ + && make GOARCH="${TARGETARCH}" GOOS="${TARGETOS}" REPO="${ORG}" NAME="${REPO}" cmd/${PKG}/${APP_NAME} \ + && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" +# skipcq: DOK-DL3026 +FROM gcr.io/distroless/static:nonroot +ARG MAINTAINER="vdaas.org vald team " LABEL maintainer="${MAINTAINER}" -ENV APP_NAME loadtest - -COPY --from=builder /usr/lib/x86_64-linux-gnu/libaec* /usr/lib/x86_64-linux-gnu/ -COPY --from=builder /usr/lib/x86_64-linux-gnu/libhdf5* /usr/lib/x86_64-linux-gnu/ -COPY --from=builder /usr/lib/x86_64-linux-gnu/libsz* /usr/lib/x86_64-linux-gnu/ - -# Copy certificates for SSL/TLS -COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ -# Copy permissions -COPY --from=builder /etc/passwd /etc/passwd -# workaround: https://github.com/moby/moby/issues/37965 -RUN true -# Copy our static executable -COPY --from=builder /usr/bin/${APP_NAME} /go/bin/${APP_NAME} +ENV APP_NAME=loadtest -ENTRYPOINT ["/go/bin/loadtest"] +COPY --from=builder /usr/bin/${APP_NAME} /usr/bin/${APP_NAME} +COPY --from=builder /tmp/config.yaml /etc/server/config.yaml +USER nonroot:nonroot +ENTRYPOINT ["/usr/bin/loadtest"] \ No newline at end of file diff --git a/docs/api/build_proto.md b/docs/api/build_proto.md index 8057b81cf12..d2bfe0516ec 100644 --- a/docs/api/build_proto.md +++ b/docs/api/build_proto.md @@ -227,9 +227,9 @@ There are many tools for building proto in Rust, we use [tonic](https://github.c } ``` - 1. `src/clinet.rs` + 1. `src/client.rs` - There are 4 steps in `src/clinet.rs`: + There are 4 steps in `src/client.rs`: 1. Load dataset 1. Insert vector to Vald cluster diff --git a/docs/api/filter-gateway.md b/docs/api/filter-gateway.md index dba621862c0..33a4349878a 100644 --- a/docs/api/filter-gateway.md +++ b/docs/api/filter-gateway.md @@ -2,7 +2,7 @@ ## Overview -Filter Servie is responsible for providing insert, update, upsert and search interface for `Vald Filter Gateway`. +Filter Server is responsible for providing insert, update, upsert and search interface for `Vald Filter Gateway`. Vald Filter Gateway forward user request to user-defined ingress/egress filter components allowing user to run custom logic. diff --git a/docs/api/remove.md b/docs/api/remove.md index b0f4c5c6412..156176fc706 100644 --- a/docs/api/remove.md +++ b/docs/api/remove.md @@ -160,10 +160,10 @@ RemoveByTimestamp RPC is the method to remove vectors based on timestamp. - Remove.Timestamp - | field | type | label | required | description | - | :-------: | :------------------------ | :---- | :------: | :------------------------------------------------ | - | timestamp | int64 | | \* | The timestamp. | - | operator | Remove.Timestamp.Operator | | | The conditionl operator. (default value is `Eq`). | + | field | type | label | required | description | + | :-------: | :------------------------ | :---- | :------: | :------------------------------------------------- | + | timestamp | int64 | | \* | The timestamp. | + | operator | Remove.Timestamp.Operator | | | The conditional operator. (default value is `Eq`). | - Remove.Timestamp.Operator diff --git a/docs/contributing/coding-style.md b/docs/contributing/coding-style.md index f8c0e0ab839..ffd67cef7cf 100644 --- a/docs/contributing/coding-style.md +++ b/docs/contributing/coding-style.md @@ -14,7 +14,7 @@ Please also read the [Contribution guideline](../contributing/contributing-guide Code formatting and naming conventions affect coding readability and maintainability. Every developer has a different coding style. Luckily Go provides tools to format source code and check for potential issues in the source code. -We recommend using [golines](https://github.com/segmentio/golines), [gofumpt](https://github.com/mvdan/gofumpt), and [goimports](https://github.com/golang/tools/tree/master/cmd/goimports) to format the source code in Vald and [golangci-lint](https://github.com/golangci/golangci-lint) with the `--enable-all` option. +We recommend using [golines](https://github.com/segmentio/golines), [gofumpt](https://github.com/mvdan/gofumpt), and [goimports](https://github.com/golang/tools/tree/master/cmd/goimports) and [crlfmt](https://github.com/cockroachdb/crlfmt) to format the source code in Vald and [golangci-lint](https://github.com/golangci/golangci-lint) with the `--enable-all` option. We suggest everyone install the plugin for your editor to format the code once you edit the code automatically and use `make format/go` command if you want to format the source code manually. But having tools to format source code does not mean you do not need to care about the formatting of the code, for example: @@ -91,7 +91,7 @@ Here are the naming conventions of the package: ```go // bad - package encodebase64 + package encode // good package base64 // inside the encoding/base64 folder @@ -273,7 +273,7 @@ The variable and the constant should be named as: ```go // bad - yamlprocessor := new(something) + yamlProcessor := new(something) // good yamlProcessor := new(something) @@ -315,7 +315,7 @@ In this section, rules also apply to the `function` (without receiver). The meth ```go // bad - func (s *something) somemethod() {} + func (s *something) someMethod() {} // bad func (s *something) some_method() {} @@ -329,7 +329,7 @@ In this section, rules also apply to the `function` (without receiver). The meth ```go // bad - func (s *something) genereateRandomNumber() int {} + func (s *something) generateRandomNumber() int {} // good func (s *something) genRandNum() int {} @@ -875,7 +875,7 @@ tests := []test { for _, tc := range tests { test := tc - t.Run(test.name, func(tt *tesint.T) { + t.Run(test.name, func(tt *testing.T) { checkFunc = defaultCheckFunc if test.checkFunc != nil { checkFunc = test.checkFunc @@ -1246,7 +1246,7 @@ In Vald, we can apply it to the different helper functions like `beforeFunc()` o ```go type test struct { ... - beforeFunc func(*testing.T) // helper function to initialze testing + beforeFunc func(*testing.T) // helper function to initialize testing afterFunc func(*testing.T) // helper function to cleanup } @@ -1318,7 +1318,7 @@ For example, we decided to mock the following implementation `Encoder`. package json type Encoder interface { - Encode(interface{}) ([]byte, error) + Encode(any) ([]byte, error) } ``` @@ -1327,7 +1327,7 @@ type encoder struct { encoder json.Encoder } -func (e *encoder) Encode(obj interface{}) ([]byte, error) { +func (e *encoder) Encode(obj any) ([]byte, error) { return e.encoder.Encode(obj) } ``` @@ -1338,10 +1338,10 @@ The following is an example of mock implementation: package json type MockEncoder struct { - EncoderFunc func(interface{}) ([]byte, error) + EncoderFunc func(any) ([]byte, error) } -func (m *MockEncoder) Encode(obj interface{}) ([]byte, error) { +func (m *MockEncoder) Encode(obj any) ([]byte, error) { return m.EncodeFunc(obj) } ``` @@ -1354,7 +1354,7 @@ tests := []test { name: "returns (byte{}, nil) when encode success" fields: fields { encoding: &json.MockEncoder { - EncoderFunc: func(interface{}) ([]byte, error) { + EncoderFunc: func(any) ([]byte, error) { return []byte{}, nil }, }, diff --git a/docs/contributing/development.md b/docs/contributing/development.md index e0d4a66cb76..c27642ee68e 100644 --- a/docs/contributing/development.md +++ b/docs/contributing/development.md @@ -25,7 +25,7 @@ This is the easiest way to start developing `Vald`. You can just open our [devco We don't officially have a setup documentation for now, but you can take a look at the [`Dockerfile`](https://github.com/vdaas/vald/blob/main/dockers/dev/Dockerfile). That's everything you need to build and test `Vald`, so you can use it as a reference. -> If you would like to use the `Dockerfile` directlly, please note that `docker-in-docker` environment is required to run our E2E tests. +> If you would like to use the `Dockerfile` directly, please note that `docker-in-docker` environment is required to run our E2E tests. > In devcontainer, [`VS Code` handles it for us](https://github.com/devcontainers/features/tree/main/src/docker-in-docker). ## Run tests diff --git a/docs/contributing/unit-test-guideline.md b/docs/contributing/unit-test-guideline.md index 4db1a310a21..833e65addfc 100644 --- a/docs/contributing/unit-test-guideline.md +++ b/docs/contributing/unit-test-guideline.md @@ -88,7 +88,7 @@ It is not only a single input, but also multi inputs. If a function or method accepts multiple inputs, we should try to create test cases to cover all the inputs. -(Note: The below `calcSum()` is diffrent function from `calsSum(val ...int32)` which we mention before.) +(Note: The below `calcSum()` is different function from `calcSum(val ...int32)` which we mention before.) ```go func calcAverageDiff(val1 []int32, val2 []int32) (diff float64) { @@ -180,7 +180,7 @@ And, you may also create unit tests based on robust boundary tests or equivalenc But, we have to take care the Vald is developed using Go. As you know as Go has many coding features as other languages. -One of the features is that Go will convert a single value to a slice value when the Function or Method receives a variadic argument (e.g., `...[]int`, `...[]string`, `...interface{}`, or etc.) as the input. +One of the features is that Go will convert a single value to a slice value when the Function or Method receives a variadic argument (e.g., `...[]int`, `...[]string`, `...any`, or etc.) as the input. And we apply the table-driven test for running unit tests. For example, when we create the unit test of `func getMeta(...[]int)`, the test code will be more complex than other functions' tests which don't use variadic argument as the input, if we create the test for all input patterns. @@ -189,15 +189,15 @@ So, we define the basic unit case slightly different from [the basic test case]( This change is very clear and you can apply it easily. Our basic test case depends on the type of two variadic arguments. -1. When input is `...interface{}` - - We have to write all test cases which satisfy `...interface{}` as same as a [basic test case](#Basic). For example, `val = 1`, `val = "input"`, `val = []float64{2020.12}` and so on. -1. When input is not `...interface{}` but `...[]int`, `...[]string` or etc. +1. When input is `...any` + - We have to write all test cases which satisfy `...any` as same as a [basic test case](#Basic). For example, `val = 1`, `val = "input"`, `val = []float64{2020.12}` and so on. +1. When input is not `...any` but `...[]int`, `...[]string` or etc. - We have to create only slice pattern test cases, which is the same as not creating test cases with a single value. - We should test with boundary cases, for example, we should test with `val = []int{math.MaxInt64()}` when the input value is `...[]int`. Summarize Vald unit test guideline: -- Apply basic test case, but take care of input variable pattern, in particular, the variadic argument (`...interface{}` or not) +- Apply basic test case, but take care of input variable pattern, in particular, the variadic argument (`...any` or not) - Apply robust boundary tests, including edge cases (e.g., `math.MaxInt64()`) - Apply equivalence class testing when needed. diff --git a/docs/overview/architecture.md b/docs/overview/architecture.md index 13149194c7f..856202b04ef 100644 --- a/docs/overview/architecture.md +++ b/docs/overview/architecture.md @@ -47,7 +47,7 @@ Here are the concepts of Vald. - Distributed vector spaces - All the vector data and indexes are distributed to Vald Agents in the Vald cluster. Whenever you search a vector in Vald cluster, all Vald agents can process parallelly and merge the result by Vald LB Gateway. + All the vector data and indexes are distributed to Vald Agents in the Vald cluster. Whenever you search a vector in Vald cluster, all Vald agents can process parallel and merge the result by Vald LB Gateway. - Kubernetes based diff --git a/docs/overview/data-flow.md b/docs/overview/data-flow.md index 57bb4e504f8..ebf0266d4ee 100644 --- a/docs/overview/data-flow.md +++ b/docs/overview/data-flow.md @@ -77,7 +77,7 @@ Upsert request updates the existing vector if the same vector ID already exists -When the user upserts a vector to Vald: +When the user upsert a vector to Vald: 1. Vald LB Gateway receives the request from the user, including the user's vector ID(s) and the vector(s). 2. Vald LB Gateway will broadcast an existing check request to the Vald Agent(s) to check if the vector exists. diff --git a/docs/tutorial/vald-multicluster-on-k8s.md b/docs/tutorial/vald-multicluster-on-k8s.md index 2da2838bb0e..6cdd344bc69 100644 --- a/docs/tutorial/vald-multicluster-on-k8s.md +++ b/docs/tutorial/vald-multicluster-on-k8s.md @@ -194,7 +194,7 @@ It requires applying the `ValdMirrorTarget` Custom Resource to the one Namespace When applied successfully, the destination information is automatically created on other Namespaces when interconnected with each `vald-mirror-gateway`. -This tutorial will deploy the [ValdMirrorTarger](https://github.com/vdaas/vald/tree/main/charts/vald/values/mirror-target.yaml) Custom Resource to the `vald-03` Namespace with the following command. +This tutorial will deploy the [ValdMirrorTarget](https://github.com/vdaas/vald/tree/main/charts/vald/values/mirror-target.yaml) Custom Resource to the `vald-03` Namespace with the following command. ```bash kubectl apply -f ./charts/vald/values/multi-vald/mirror-target.yaml -n vald-03 diff --git a/docs/user-guides/configuration.md b/docs/user-guides/configuration.md index f54def2a171..31655186a3a 100644 --- a/docs/user-guides/configuration.md +++ b/docs/user-guides/configuration.md @@ -190,7 +190,7 @@ The important parameters are the followings: - `agent.faiss.nlist` Users should configure these parameters first to fit their use case. -For further details, please read [the Fiass wiki][faiss-wiki]. +For further details, please read [the Faiss wiki][faiss-wiki]. Vald Agent Faiss has a feature to start indexing automatically. The behavior of this feature can be configured with these parameters: @@ -394,7 +394,7 @@ For further details, there are references to the Helm values in the Vald GitHub - [README of Vald Helm Chart][vald-helm-chart] - [README of Vald-Helm-Operator Chart][vald-helm-operator-chart] - + [vald-helm-chart]: https://github.com/vdaas/vald/tree/main/charts/vald [vald-helm-operator-chart]: https://github.com/vdaas/vald/tree/main/charts/vald-helm-operator diff --git a/docs/user-guides/deployment.md b/docs/user-guides/deployment.md index 68a50f904ff..adffdef08db 100644 --- a/docs/user-guides/deployment.md +++ b/docs/user-guides/deployment.md @@ -138,7 +138,7 @@ After create `values.yaml`, you can deploy by the following steps. When you need to update the configuration, you can update by following command with your new `values.yaml`. ```bash -helm upgrate vald vald/vald --values +helm upgrade vald vald/vald --values ``` ### Cleanup diff --git a/docs/user-guides/observability-configuration.md b/docs/user-guides/observability-configuration.md index 66617e874b2..677781f191b 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 694a213213a..41aa64f2e3b 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 bddbb70677e..77cf7eee483 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 2c9b6a8e7a4..b94c1495118 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-20240722135656-d784300faade + google.golang.org/genproto/googleapis/api => google.golang.org/genproto/googleapis/api v0.0.0-20240722135656-d784300faade + google.golang.org/genproto/googleapis/rpc => google.golang.org/genproto/googleapis/rpc v0.0.0-20240722135656-d784300faade + 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-20240701130421-f6361c86f094 // indirect + google.golang.org/protobuf v1.34.2 // indirect ) diff --git a/example/client/go.mod.default b/example/client/go.mod.default index eba3aefdcfa..14c78eebdf6 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 c526bb0895a..89f26954222 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-20240722135656-d784300faade h1:WxZOF2yayUHpHSbUE6NMzumUzBxYc3YGwo0YHnbzsJY= +google.golang.org/genproto/googleapis/api v0.0.0-20240722135656-d784300faade/go.mod h1:mw8MG/Qz5wfgYr6VqVCiZcHe/GJEfI+oGGDCohaVgB0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240722135656-d784300faade h1:oCRSWfwGXQsqlVdErcyTt4A93Y8fo0/9D4b1gnI++qo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240722135656-d784300faade/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 b57c895c9d4..c323a1e3ba5 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 38d586ed648..8e8f4b074ea 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/go.mod b/go.mod index 92a8a9826a2..9cacf577122 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.0 + 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 @@ -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-20240722135656-d784300faade + google.golang.org/genproto/googleapis/api => google.golang.org/genproto/googleapis/api v0.0.0-20240722135656-d784300faade + google.golang.org/genproto/googleapis/rpc => google.golang.org/genproto/googleapis/rpc v0.0.0-20240722135656-d784300faade + 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-20240711142825-46eb208f015d + 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.10 // 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 268541e1d4d..4a2ed5b8886 100644 --- a/go.sum +++ b/go.sum @@ -1,149 +1,155 @@ -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 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.9/go.mod h1:teNI+P/xzZ3dppGXEYFvSmuOvmTjLE9toPq21WHssYc= 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/accesscontextmanager v1.8.9/go.mod h1:IXvQesVgOC7aXgK9OpYFn5eWnzz8fazegIiJ5WnCOVw= +cloud.google.com/go/aiplatform v1.68.0/go.mod h1:105MFA3svHjC3Oazl7yjXAmIR89LKhRAeNdnDKJczME= +cloud.google.com/go/analytics v0.23.4/go.mod h1:1iTnQMOr6zRdkecW+gkxJpwV0Q/djEIII3YlXmyf7UY= +cloud.google.com/go/apigateway v1.6.9/go.mod h1:YE9XDTFwq859O6TpZNtatBMDWnMRZOiTVF+Ru3oCBeY= +cloud.google.com/go/apigeeconnect v1.6.9/go.mod h1:tl53uGgVG1A00qK1dF6wGIji0CQIMrLdNccJ6+R221U= +cloud.google.com/go/apigeeregistry v0.8.7/go.mod h1:Jge1HQaIkNU8JYSDY7l5SveeSKvGPvtLjzNjLU2+0N8= +cloud.google.com/go/appengine v1.8.9/go.mod h1:sw8T321TAto/u6tMinv3AV63olGH/hw7RhG4ZgNhqFs= +cloud.google.com/go/area120 v0.8.9/go.mod h1:epLvbmajRp919r1LGdvS1zgcHJt/1MTQJJ9+r0/NBQc= +cloud.google.com/go/artifactregistry v1.14.11/go.mod h1:ahyKXer42EOIddYzk2zYfvZnByGPdAYhXqBbRBsGizE= +cloud.google.com/go/asset v1.19.3/go.mod h1:1j8NNcHsbSE/KeHMZrizPIS6c8nm0WjEAPoFXzXNCj4= +cloud.google.com/go/assuredworkloads v1.11.9/go.mod h1:uZ6+WHiT4iGn1iM1wk5njKnKJWiM3v/aYhDoCoHxs1w= 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.9/go.mod h1:KECCWW2AFsRuEVxUJEIXxcm3yPLf1rxS+qsBamyacMc= +cloud.google.com/go/baremetalsolution v1.2.8/go.mod h1:Ai8ENs7ADMYWQ45DtfygUc6WblhShfi3kNPvuGv8/ok= +cloud.google.com/go/batch v1.9.0/go.mod h1:VhRaG/bX2EmeaPSHvtptP5OAhgYuTrvtTAulKM68oiI= +cloud.google.com/go/beyondcorp v1.0.8/go.mod h1:2WaEvUnw+1ZIUNu227h71X/Q8ypcWWowii9TQ4xlfo0= +cloud.google.com/go/bigquery v1.62.0/go.mod h1:5ee+ZkF1x/ntgCsFQJAQTM3QkAZOecfCmvxhkJsWRSA= +cloud.google.com/go/billing v1.18.7/go.mod h1:RreCBJPmaN/lzCz/2Xl1hA+OzWGqrzDsax4Qjjp0CbA= +cloud.google.com/go/binaryauthorization v1.8.5/go.mod h1:2npTMgNJPsmUg0jfmDDORuqBkTPEW6ZSTHXzfxTvN1M= +cloud.google.com/go/certificatemanager v1.8.3/go.mod h1:QS0jxTu5wgEbzaYgGs/GBYKvVgAgc9jnYaaTFH8jRtE= +cloud.google.com/go/channel v1.17.9/go.mod h1:h9emIJm+06sK1FxqC3etsWdG87tg92T24wimlJs6lhY= +cloud.google.com/go/cloudbuild v1.16.3/go.mod h1:KJYZAwTUaDKDdEHwLj/EmnpmwLkMuq+fGnBEHA1LlE4= +cloud.google.com/go/clouddms v1.7.8/go.mod h1:KQpBMxH99ZTPK4LgXkYUntzRQ5hcNkjpGRbNSRzW9Nk= +cloud.google.com/go/cloudtasks v1.12.10/go.mod h1:OHJzRAdE+7H00cdsINhb21ugVLDgk3Uh4r0holCB5XQ= +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.4/go.mod h1:6OWSyQxeaQRxhkyMhtE+RFOOlsMcKOTukv8nnjxbNCQ= +cloud.google.com/go/container v1.37.2/go.mod h1:2ly7zpBmWtYjjuoB3fHyq8Gqrxaj2NIwzwVRpUcKYXk= +cloud.google.com/go/containeranalysis v0.11.8/go.mod h1:2ru4oxs6dCcaG3ZsmKAy4yMmG68ukOuS/IRCMEHYpLo= +cloud.google.com/go/datacatalog v1.20.3/go.mod h1:AKC6vAy5urnMg5eJK3oUjy8oa5zMbiY33h125l8lmlo= +cloud.google.com/go/dataflow v0.9.9/go.mod h1:Wk/92E1BvhV7qs/dWb+3dN26uGgyp/H1Jr5ZJxeD3dw= +cloud.google.com/go/dataform v0.9.6/go.mod h1:JKDPMfcYMu9oUMubIvvAGWTBX0sw4o/JIjCcczzbHmk= +cloud.google.com/go/datafusion v1.7.9/go.mod h1:ciYV8FL0JmrwgoJ7CH64oUHiI0oOf2VLE45LWKT51Ls= +cloud.google.com/go/datalabeling v0.8.9/go.mod h1:61QutR66VZFgN8boHhl4/FTfxenNzihykv18BgxwSrg= +cloud.google.com/go/dataplex v1.18.0/go.mod h1:THLDVG07lcY1NgqVvjTV1mvec+rFHwpDwvSd+196MMc= +cloud.google.com/go/dataproc/v2 v2.5.1/go.mod h1:5s2CuQyTPX7e19ZRMLicfPFNgXrvsVct3xz94UvWFeQ= +cloud.google.com/go/dataqna v0.8.9/go.mod h1:wrw1SL/zLRlVgf0d8P0ZBJ2hhGaLbwoNRsW6m1mn64g= +cloud.google.com/go/datastore v1.17.1/go.mod h1:mtzZ2HcVtz90OVrEXXGDc2pO4NM1kiBQy8YV4qGe0ZM= +cloud.google.com/go/datastream v1.10.8/go.mod h1:6nkPjnk5Qr602Wq+YQ+/RWUOX5h4voMTz5abgEOYPCM= +cloud.google.com/go/deploy v1.19.2/go.mod h1:i6zfU9FZkqFgWIvO2/gsodGU9qF4tF9mBgoMdfnf6as= +cloud.google.com/go/dialogflow v1.54.2/go.mod h1:avkFNYog+U127jKpGzW1FOllBwZy3OfCz1K1eE9RGh8= +cloud.google.com/go/dlp v1.14.2/go.mod h1:+uwRt+6wZ3PL0wsmZ1cUAj0Mt9kyeV3WcIKPW03wJVU= +cloud.google.com/go/documentai v1.30.3/go.mod h1:aMxiOouLr36hyahLhI3OwAcsy7plOTiXR/RmK+MHbSg= +cloud.google.com/go/domains v0.9.9/go.mod h1:/ewEPIaNmTrElY7u9BZPcLPnoP1NJJXGvISDDapwVNU= +cloud.google.com/go/edgecontainer v1.2.3/go.mod h1:gMKe2JfE0OT0WuCJArzIndAmMWDPCIYGSWYIpJ6M7oM= +cloud.google.com/go/errorreporting v0.3.1/go.mod h1:6xVQXU1UuntfAf+bVkFk6nld41+CPyF2NSPCyXE3Ztk= +cloud.google.com/go/essentialcontacts v1.6.10/go.mod h1:wQlXvEb/0hB0C0d4H6/90P8CiZcYewkvJ3VoUVFPi4E= +cloud.google.com/go/eventarc v1.13.8/go.mod h1:Xq3SsMoOAn7RmacXgJO7kq818iRLFF0bVhH780qlmTs= +cloud.google.com/go/filestore v1.8.5/go.mod h1:o8KvHyl5V30kIdrPX6hE+RknscXCUFXWSxYsEWeFfRU= 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.4/go.mod h1:uDp5MbH0kCtXe3uBluq3Zi7bEDuHqcn60mAHxUsNezI= +cloud.google.com/go/gkebackup v1.5.2/go.mod h1:ZuWJKacdXtjiO8ry9RrdT57gvcsU7c7/FTqqwjdNUjk= +cloud.google.com/go/gkeconnect v0.8.9/go.mod h1:gl758q5FLXewQZIsxQ7vHyYmLcGBuubvQO6J3yFDh08= +cloud.google.com/go/gkehub v0.14.9/go.mod h1:W2rDU2n2xgMpf3/BqpT6ffUX/I8yez87rrW/iGRz6Kk= +cloud.google.com/go/gkemulticloud v1.2.2/go.mod h1:VMsMYDKpUVYNrhese31TVJMVXPLEtFT/AnIarqlcwVo= +cloud.google.com/go/grafeas v0.3.6/go.mod h1:to6ECAPgRO2xeqD8ISXHc70nObJuaKZThreQOjeOH3o= +cloud.google.com/go/gsuiteaddons v1.6.9/go.mod h1:qITZZoLzQhMQ6Re+izKEvz4C+M1AP13S+XuEpS26824= +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.8/go.mod h1:jQzSbtpYRbBoMdOINr/OqUxBY9rhyqLx04utTCmJ6oo= +cloud.google.com/go/ids v1.4.9/go.mod h1:1pL+mhlvtUNphwBSK91yO8NoTVQYwOpqim1anIVBwbM= +cloud.google.com/go/iot v1.7.9/go.mod h1:1fi6x4CexbygNgRPn+tcxCjOZFTl+4G6Adbo6sLPR7c= +cloud.google.com/go/kms v1.18.3/go.mod h1:y/Lcf6fyhbdn7MrG1VaDqXxM8rhOBc5rWcWAhcvZjQU= +cloud.google.com/go/language v1.12.7/go.mod h1:4s/11zABvI/gv+li/+ICe+cErIaN9hYmilf9wrc5Py0= +cloud.google.com/go/lifesciences v0.9.9/go.mod h1:4c8eLVKz7/FPw6lvoHx2/JQX1rVM8+LlYmBp8h5H3MQ= +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/longrunning v0.5.9 h1:haH9pAuXdPAMqHvzX0zlWQigXT7B0+CL4/2nXXdBo5k= +cloud.google.com/go/longrunning v0.5.9/go.mod h1:HD+0l9/OOW0za6UWdKJtXoFAX/BGg/3Wj8p10NeWF7c= +cloud.google.com/go/managedidentities v1.6.9/go.mod h1:R7+78iH2j/SCTInutWINxGxEY0PH5rpbWt6uRq0Tn+Y= +cloud.google.com/go/maps v1.11.3/go.mod h1:4iKNrUzFISQ4RoiWCqIFEAAVtgKb2oQ09AVx8GheOUg= +cloud.google.com/go/mediatranslation v0.8.9/go.mod h1:3MjXTUsEzrMC9My6e9o7TOmgIUGlyrkVAxjzcmxBUdU= +cloud.google.com/go/memcache v1.10.9/go.mod h1:06evGxt9E1Mf/tYsXJNdXuRj5qzspVd0Tt18kXYDD5c= +cloud.google.com/go/metastore v1.13.8/go.mod h1:2uLJBAXn5EDYJx9r7mZtxZifCKpakZUCvNfzI7ejUiE= +cloud.google.com/go/monitoring v1.20.2/go.mod h1:36rpg/7fdQ7NX5pG5x1FA7cXTVXusOp6Zg9r9e1+oek= +cloud.google.com/go/networkconnectivity v1.14.8/go.mod h1:QQ/XTMk7U5fzv1cVNUCQJEjpkVEE+nYOK7mg3hVTuiI= +cloud.google.com/go/networkmanagement v1.13.4/go.mod h1:dGTeJfDPQv0yGDt6gncj4XAPwxktjpCn5ZxQajStW8g= +cloud.google.com/go/networksecurity v0.9.9/go.mod h1:aLS+6sLeZkMhLx9ntTMJG4qWHdvDPctqMOb6ggz9m5s= +cloud.google.com/go/notebooks v1.11.7/go.mod h1:lTjloYceMboZanBFC/JSZYet/K+JuO0mLAXVVhb/6bQ= +cloud.google.com/go/optimization v1.6.7/go.mod h1:FREForRqqjTsJbElYyWSgb54WXUzTMTRyjVT+Tl80v8= +cloud.google.com/go/orchestration v1.9.4/go.mod h1:jk5hczI8Tciq+WCkN32GpjWJs67GSmAA0XHFUlELJLw= 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/orgpolicy v1.12.5/go.mod h1:f778/jOHKp6cP6NbbQgjy4SDfQf6BoVGiSWdxky3ONQ= 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/osconfig v1.13.0/go.mod h1:tlACnQi1rtSLnHRYzfw9SH9zXs0M7S1jqiW2EOCn2Y0= +cloud.google.com/go/oslogin v1.13.5/go.mod h1:V+QzBAbZBZJq9CmTyzKrh3rpMiWIr1OBn6RL4mMVWXI= +cloud.google.com/go/phishingprotection v0.8.9/go.mod h1:xNojFKIdq+hNGNpOZOEGVGA4Mdhm2yByMli2Ni/RV0w= +cloud.google.com/go/policytroubleshooter v1.10.7/go.mod h1:/JxxZOSCT8nASvH/SP4Bj81EnDFwZhFThG7mgVWIoPY= +cloud.google.com/go/privatecatalog v0.9.9/go.mod h1:attFfOEf8ECrCuCdT3WYY8wyMKRZt4iB1bEWYFzPn50= +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.0/go.mod h1:pwC/eCyXq37YV3NSaiJsfOmuoTDkzURnVKAWGSkjDUY= +cloud.google.com/go/recommendationengine v0.8.9/go.mod h1:QgE5f6s20QhCXf4UR9KMI/Q6Spykd2zEYXX2oBz6Cbs= +cloud.google.com/go/recommender v1.12.5/go.mod h1:ggh5JNuG5ajpRqqcEkgni/DjpS7x12ktO+Edu8bmCJM= +cloud.google.com/go/redis v1.16.2/go.mod h1:bn/4nXSZkoH4QTXRjqWR2AZ0WA1b13ct354nul2SSiU= +cloud.google.com/go/resourcemanager v1.9.9/go.mod h1:vCBRKurJv+XVvRZ0XFhI/eBrBM7uBOPFjMEwSDMIflY= +cloud.google.com/go/resourcesettings v1.7.2/go.mod h1:mNdB5Wl9/oVr9Da3OrEstSyXCT949ignvO6ZrmYdmGU= +cloud.google.com/go/retail v1.17.2/go.mod h1:Ad6D8tkDZatI1X7szhhYWiatZmH6nSUfZ3WeCECyA0E= +cloud.google.com/go/run v1.3.9/go.mod h1:Ep/xsiUt5ZOwNptGl1FBlHb+asAgqB+9RDJKBa/c1mI= +cloud.google.com/go/scheduler v1.10.10/go.mod h1:nOLkchaee8EY0g73hpv613pfnrZwn/dU2URYjJbRLR0= +cloud.google.com/go/secretmanager v1.13.4/go.mod h1:SjKHs6rx0ELUqfbRWrWq4e7SiNKV7QMWZtvZsQm3k5w= +cloud.google.com/go/security v1.17.2/go.mod h1:6eqX/AgDw56KwguEBfFNiNQ+Vzi+V6+GopklexYuJ0U= +cloud.google.com/go/securitycenter v1.32.0/go.mod h1:s1dN6hM6HZyzUyJrqBoGvhxR/GecT5u48sidMIgDxTo= +cloud.google.com/go/servicedirectory v1.11.9/go.mod h1:qiDNuIS2qxuuroSmPNuXWxoFMvsEudKXP62Wos24BsU= +cloud.google.com/go/shell v1.7.9/go.mod h1:h3wVC6qaQ1nIlSWMasl1e/uwmepVbZpjSk/Bn7ZafSc= +cloud.google.com/go/spanner v1.64.0/go.mod h1:TOFx3pb2UwPsDGlE1gTehW+y6YlU4IFk+VdDHSGQS/M= +cloud.google.com/go/speech v1.23.3/go.mod h1:u7tK/jxhzRZwZ5Nujhau7iLI3+VfJKYhpoZTjU7hRsE= +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.8/go.mod h1:fEGWYffkV9OYOKms8nxyJWIZA7iEWPl2Mybk6bpQnEk= +cloud.google.com/go/talent v1.6.10/go.mod h1:q2/qIb2Eb2svmeBfkCGIia/NGmkcScdyYSyNNOgFRLI= +cloud.google.com/go/texttospeech v1.7.9/go.mod h1:nuo7l7CVWUMvaTgswbn/hhn2Tv73/WbenqGyc236xpo= +cloud.google.com/go/tpu v1.6.9/go.mod h1:6C7Ed7Le5Y1vWGR+8lQWsh/gmqK6l53lgji0YXBU40o= +cloud.google.com/go/trace v1.10.10/go.mod h1:5b1BiSYQO27KgGRevNFfoIQ8czwpVgnkKbTLb4wV+XM= +cloud.google.com/go/translate v1.10.5/go.mod h1:n9fFca4U/EKr2GzJKrnQXemlYhfo1mT1nSt7Rt4l/VA= +cloud.google.com/go/video v1.21.2/go.mod h1:UNXGQj3Hdyb70uaF9JeeM8Y8BAmAzLEMSWmyBKY2iVM= +cloud.google.com/go/videointelligence v1.11.9/go.mod h1:Mv0dgb6U12BfBRPj39nM/7gcAFS1+VVGpTiyMJ/ShPo= +cloud.google.com/go/vision/v2 v2.8.4/go.mod h1:qlmeVbmCfPNuD1Kwa7/evqCJYoJ7WhiZ2XeVSYwiOaA= +cloud.google.com/go/vmmigration v1.7.9/go.mod h1:x5LQyAESUXsI7/QAQY6BV8xEjIrlkGI+S+oau/Sb0Gs= +cloud.google.com/go/vmwareengine v1.1.5/go.mod h1:Js6QbSeC1OgpyygalCrMj90wa93O3kFgcs/u1YzCKsU= +cloud.google.com/go/vpcaccess v1.7.9/go.mod h1:Y0BlcnG9yTkoM6IL6auBeKvVEXL4LmNIxzscekrn/uk= +cloud.google.com/go/webrisk v1.9.9/go.mod h1:Wre67XdNQbt0LCBrvwVNBS5ORb8ssixq/u04CCZoO+k= +cloud.google.com/go/websecurityscanner v1.6.9/go.mod h1:xrMxPiHB5iFxvc2tqbfUr6inPox6q6y7Wg0LTyZOKTw= +cloud.google.com/go/workflows v1.12.8/go.mod h1:b7akG38W6lHmyPc+WYJxIYl1rEv79bBMYVwEZmp3aJQ= +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 +158,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 +174,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 +202,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.0 h1:hVALKPjXz33kP1R9nTyJpUK7qF59dO2mleQxUW9mCVE= +github.com/aws/aws-sdk-go v1.55.0/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,9 +257,6 @@ 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= @@ -269,8 +274,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 +306,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 +335,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 +354,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 +374,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 +390,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 +409,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 +440,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 +462,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 +485,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 +507,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 +529,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 +550,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 +588,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 +621,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 +661,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 +704,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-20240722135656-d784300faade h1:lKFsS7wpngDgSCeFn7MoLy+wBDQZ1UQIJD4UNM1Qvkg= +google.golang.org/genproto v0.0.0-20240722135656-d784300faade/go.mod h1:FfBgJBJg9GcpPvKIuHSZ/aE1g2ecGL74upMzGZjiGEY= +google.golang.org/genproto/googleapis/api v0.0.0-20240722135656-d784300faade h1:WxZOF2yayUHpHSbUE6NMzumUzBxYc3YGwo0YHnbzsJY= +google.golang.org/genproto/googleapis/api v0.0.0-20240722135656-d784300faade/go.mod h1:mw8MG/Qz5wfgYr6VqVCiZcHe/GJEfI+oGGDCohaVgB0= +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-20240722135656-d784300faade h1:oCRSWfwGXQsqlVdErcyTt4A93Y8fo0/9D4b1gnI++qo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240722135656-d784300faade/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 +731,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 +782,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 54a51f3f81c..ecb126bd9ee 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 b570cd29f6c..486e6d40548 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 a9c184cb1d0..f87e045f8c4 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 de5d820398f..2c833bc9236 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 ba587dafc10..34e3bd0abd5 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 a37f2c592f5..b251a26e61a 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 85cadc1f4bd..476f90e07b1 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 3314bfb096d..dc0897fd4ee 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 effa4577a09..e0a4776744f 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 fd6c090ffb4..ecf3bda13a5 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 82c2e030c4a..49b007b5f85 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 af1a1f3735a..32235037ce9 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 30105ee777a..e1c4195e764 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 6163981226d..3ac36b05db4 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 c8eeec982f7..d3cbd71a12f 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 8f3712fa398..e431b89ebaf 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 1100c35e172..b8e5e4412ea 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 a90d4a77783..f61af649f84 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 b46356f052b..0a5221aa471 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 5255c610f31..9f3eb41bc9d 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 f924e5a8149..a35c14454f6 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 e9480320108..33ea3d320e6 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 9a3f4029d31..a767e1672c6 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 00000000000..34c9425864c --- /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 fce9fcff2a7..0405069719a 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 a6b76d935cd..c33a973129d 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 d077ad669bd..d130fe4a066 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 68f28a86d02..a13db09c43e 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 8e8b219a9f8..04c1355739d 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 b907b197251..4cf3bc2df34 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 24709f6d9c5..246d70ae95b 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 215ce148704..5a9fac4863c 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 4f11ec58896..29c499c000c 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 f02d299c4b1..e521f84c14a 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 34bffe2ff2a..756cfd15162 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 1f6c41a45fd..cf587067dbe 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 4dfc45f55cd..10874ac9b27 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 6f37d9cb933..525a1a055b3 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 3416aca136b..4c3b71363bb 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 32b0d86ebb1..83c98c46db2 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 6fbc8fcf8e7..3e550db6359 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 68cac7523eb..56c88e58879 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 616de1fabc3..de28b66eb24 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 4d671a87716..981dd69f81f 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 0cc5b2b87af..6e5220d3449 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 0c8338acb8c..cfaff138394 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 af769c0e967..c37f4ff8acb 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 fecc3dd1515..68545c880f5 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 f17c171814d..7e170f41849 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 df60f7ac2c4..a104dc8aa19 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 fba7c949a60..5fe764e5f25 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 364ba64a692..1591b110992 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 2000cb4b257..5013302b2bb 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 49f8e7501d3..a4365f6c2f9 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 650d28caafc..e7d7b757ede 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 1f0b4d3fac4..69d2a17ab28 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 d2dc8854bd8..26e7cc1da0f 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 233bfa3504b..1543da2e997 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 c78823b211d..7c713a3e120 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 19b164418b4..4ed9a3fb923 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 46780e6a7cd..0682f2f1d59 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 bc650937945..e123403154d 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 636b9fb64d3..2cad19ccc34 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 f04e4700291..fc7307be834 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 5f60464b6ce..8d96e916c8e 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 01e9370352f..56b0cd1d168 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 5c88971ac0d..ce5dc2d02d7 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 94d7463355a..d0de5b6d7cb 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 575265a41cb..28ccb2a0568 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 b7653f0908e..b3e75bc3c89 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 e962a50fff2..f58bd2d822b 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 c4acc67e737..b03da989a3d 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 937d890c5dc..3c994a84554 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 6a3bebdaf53..cc4af2bae33 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 01ca3e51539..fea202bcf6e 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 5b20fc90621..b6b61f6749c 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 c38a658205a..030469eb3a5 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 ea2b258268c..cb0ecd46ac5 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 3feb17129fd..360045f8476 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 e73f8880096..191ee102f6f 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 e7165313e17..4cb67e7c687 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 92ef365b93a..c5af30b93e6 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 170ff2a5a0f..e4e8e670081 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 6980689ca77..b2f13f9bff7 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 dd5a802ea54..e22c4513984 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 296e978f7f6..4df32439123 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 f79da1c52d1..bc44be9f2bb 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 874e2c7525c..8b3bda142b3 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 314ac7e933f..8fba808ddee 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 337a86f3f70..01d3a1351d0 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 4c532d57c09..77ccce31675 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 0d4ceca89e6..210800f347b 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 2089cc4d601..9801de58025 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 6e97b2f7c88..238a3b0de61 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 f8c820701d0..6f5f31e0f93 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 16962351556..d91761c292e 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 0d8e1e04b36..00000000000 --- 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 b73b026daf6..63c58e79b8d 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 b7d1c7c6c20..a31a21b12fe 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 9c3aafb88f9..099afd9f1ba 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 51fb0fa6375..13680c7924f 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 f02d15b7f73..a580438aec1 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 cdde4fc2c16..31590191ac2 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 d714900d698..db984ef28c2 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 ab8fb8eb4ed..ae4eeacb271 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 6eb1e468449..398861fa23f 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 5a9d649666a..8d5d57452fc 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 f779c710f4d..ada6e65b581 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 1229f1620ce..065ec1419c7 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 f15b62d4dd3..0a499ac4836 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 88839d4395f..b6bb554763c 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 e24cf48e190..7ec2e1b2ffa 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 60538c5b560..7325f5037ce 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 f0d231f1535..a6fdffa6834 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 6a1b7d0e26c..18804267205 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 eb1d7f89ac3..6e07d0a2e82 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 cbfb1f60aea..aeba23c73e3 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 8b5912ac3af..de0d6da925f 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 ddbd4102849..0c1493bd403 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 461c1f5f5b1..b3ec1edc03b 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 d7ecbe6f8ae..e6ffb8d901b 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 b34290d8abb..b14bf0237ca 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 7c5f15ec076..2d205461abe 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 5f30169ea19..06f83867d41 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 dc7fac6ee8e..edc39ce74d1 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 f9fa60f34b2..fed2b59adf7 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 d84600504c5..c9fa659ca36 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 89a723d037f..e731e8ea093 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 b627b00b9c1..d90d2c70189 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 702df024277..004e860442a 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 f64ad0fb1d3..fdc0db96981 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 12e564d05d7..d8c9d8432d5 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 796bb670147..615499b869f 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 c073d75b8bf..bc40f048335 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 28ab6f28430..f49cf4ef21c 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 33a78180593..bc0d9a23c25 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 ff6571043a0..8eda81e568c 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 66e320bc1bf..1380b08479f 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 291a8c0c835..b6a4f3eceb1 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 da238411a45..facab61fbc6 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 f19824197b3..588bbb70e19 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 6c9b941f709..4aa8c81c460 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 1b24f34fc61..ad84b6c0b2e 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 0dd719afced..0a800771061 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 916a248aede..cb6cb0b9365 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 ffe74f2c121..e6421b42687 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 aee5a63edc3..baa4f81b31c 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 5da857a7586..9de30d1aaae 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 15ced6c53ee..574386d4834 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 12a6a313d62..dfcfc0bd076 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 4c18a7d3ab8..064b544a54d 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 7583e4c6d47..5d615d1e71a 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 9bb199ac2a0..e0c3d347767 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 bea96c29214..cfd0ff085fa 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 04d386bc649..31c18c01d76 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 492280a8044..73927fcf9a8 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 dbe00b61308..d8b715dca77 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 ad4332554b0..9a523fa2f78 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 89d806e281e..4e9734baad5 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 40dd5539c29..4e535713e0c 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 aed11fa6cbf..f93608be5e5 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 221a7f64a69..a0f3dbef24d 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 d7d5c258ce9..30a5dbe3d9a 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 3508be7d0c9..3ea905a2f43 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 4400571c760..b78109d901b 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 128c6231e63..9048bf9f76b 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 f3a0549efb4..82b49bfe2b7 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 f295d50f640..0af9f6a5f32 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 d87f2f98c99..5185980eef8 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 3892992c924..1fba9ead3ce 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 590b9c07f97..b6f793f3e2d 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 370e07cbff1..426083996c7 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 48a9adfd835..dc7390c61d4 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 cc3f42fa5bf..71845ab2761 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 c0db32be031..56cd0c89122 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 8d9f762e50e..7dcd7a3356a 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 603e146e015..17c5dfec6f1 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 b97ba4b8a22..0ede371a3ec 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 ebd322a5366..9caf79535fa 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 801bc914bc3..22dd211a4f5 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 cada14bd204..f37a08ce9d5 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 69b970e0936..7eeafe2f7eb 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 13d2ada450a..d3305fab9f9 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 021933f2b8a..b6921c9e559 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 ac2f9a3a24f..e847b098058 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 5453a716658..6d68d44f036 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 bb5f0cd0e03..6d6b4f142cd 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 96baff34bee..ec0e075298c 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 b8bd60fd1c9..7ec38894a47 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 8d83768daca..e29fc50c5d3 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 858a5819a47..c853f27d4e2 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 9a3c628ccb6..dfce1c16b9e 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 c08fec54142..039f1945adc 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 b9051179d9c..2e4c2abcc85 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 4b85ddaa711..5c6c5896ced 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 ea22a48300b..4b79670e46e 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 2754ef2bc42..756fce782e4 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 d33f32f1d3d..64811db689d 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 872e75dc0e3..4c203a9f6ea 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 a3447788f00..6742640aea7 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 dbaef33c9c8..12985653513 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 03d5eb2813d..b12c0ed3c8e 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 356afc06326..f975178d6da 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 b871582f288..b48573b775e 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 ff5d43596f7..a8cb4529c05 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 9cbaea4496a..a2f0e31d15a 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 bbe5a45c4de..4cbc2243842 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 ca5b4f371db..da7d95edc62 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 38675e58c97..1d78d7a7d4f 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 108e8087156..ef1c80bab96 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 3f8a85c7442..a5b11e4f7c3 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 cdba1128963..a622b1d47e0 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 e6efdfaf75c..78cdd63e521 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 76414465006..439c382133e 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 d4be3907c93..ed46791b4e0 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 1bb8f4af414..fa223ca69de 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 abe0d374cdc..1c138614283 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 ea7ec38b3d9..e55c19963bf 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 f4f3f256997..743736f435e 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 f57685bbb14..b246b2434cc 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 3c0e43dc847..6543fd9cedc 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 0a76d7395f3..b650c15e835 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 e1b39609dc3..9bf49a2ea4c 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 b6594a2b49a..310bbb2fd74 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 f1e1a809020..dfeed90d5b2 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 3280bcfb88f..5880b836f49 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 3adcf187266..d8bf88a23d2 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 06198c69dda..258f65b6f27 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 ce3fd8552f6..ae073c52984 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 34a8dda12e2..9a21b07b06c 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 ea7884a2825..f183298e76d 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 608300ea3e2..91e9e8c523d 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 91dff94d657..0d7312deef7 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 fff4de8eafe..b29fbce0c4d 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 588bd3f0e0e..9a3fec538da 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 188a057a66e..576ae11f0b6 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 a551d920ce0..c95b02420dd 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 aadf86077f4..dd42febe0b7 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 bb2a7b24a76..f8d4c363c6f 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 15d81aeed20..a45c2644660 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 21eededf57e..596762cabcb 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 b79ac366af4..a25d06078e5 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 7251d072734..06a2287980c 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 83a76074538..49a6947209c 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 4c67a793256..e10f854aa63 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 8ae522c9ff2..53c259c9e15 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 b348b666390..66b04744152 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 edafb8e872f..45226b4806c 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 59ab5564a4f..cc14471d7fd 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 105cd3ec6f5..777938a4ee1 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 7b3e7d17825..ce38a5e3b3f 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 c5e41ad8fed..43c2929d302 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 d2a8b9dbd80..674f7b93aa8 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 baaed0ae4c0..d0c8c924f9b 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 c23eb8d510a..b5ab31609bc 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 0ea917a8fb7..073bf39e02a 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 f8350eef97e..3913271e6b4 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 83ac1eb4e88..87a01591163 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 e3c8bfec6b5..9975e31b1a3 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 a3e8325ba4a..192caa0fb56 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 9f7c7b1c488..dc9f4769589 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 c2e0e71aa11..323db08081d 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 baa60334b22..b910f2742a6 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 7318ce15fbf..e937ff8a3af 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 3323225bb68..d521b356ffb 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 258d5d9c7d0..c3e9d356f4f 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 ec39e2913d7..115765c052e 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 834aae2f689..b88a3b9b9b3 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 4d6b39729b3..42e90b1c9ba 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 40854f98d6e..f5cb8a5ce89 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 c3fffb7dc24..ec6b76d662b 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 a891fc487f0..0591b321234 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 1de50690552..091b03c4220 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 4b0fb7e4592..f0a1764d9d9 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 29c2ad522e0..6881ff91e84 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 1de50690552..091b03c4220 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 438967f1fa0..187673d5270 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 f1f6d2afd2d..acd03fd9249 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 482dabba32f..c06dea16ccf 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 5621b67b37b..1649fea69f8 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 bf310dc49b2..1c9ce5525ba 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 ed9cb829198..52e141cc1e4 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 2b1bf9f5dad..a3b0536f09b 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 087fab4ac94..54562961c53 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 7a12be9f9d0..c22c500f477 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 4c8324f35e0..963f89bc9cb 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 7b5091dc9e0..722a924d7c1 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 59ff70724ee..76e755f543d 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", ] @@ -31,9 +31,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" @@ -59,9 +59,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", @@ -121,9 +121,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", @@ -157,21 +157,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" @@ -191,9 +191,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", @@ -203,9 +203,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", @@ -218,15 +218,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", @@ -235,9 +235,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" @@ -247,9 +247,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", @@ -313,9 +313,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" @@ -378,9 +378,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" @@ -390,9 +390,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", @@ -467,9 +467,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" @@ -482,9 +482,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 = "lock_api" @@ -504,9 +504,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" @@ -547,9 +547,9 @@ 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", ] @@ -595,9 +595,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.2" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" dependencies = [ "memchr", ] @@ -616,9 +616,9 @@ checksum = "caff54706df99d2a78a5a4e3455ff45448d81ef1bb63c22cd14052ca0e993a3f" [[package]] name = "parking_lot" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -634,7 +634,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -683,18 +683,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", @@ -702,9 +702,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", @@ -715,9 +715,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", ] @@ -773,11 +773,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -792,7 +792,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", @@ -801,9 +801,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 = "scopeguard" @@ -819,18 +819,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", @@ -900,9 +900,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", @@ -947,18 +947,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", @@ -967,9 +967,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.37.0" +version = "1.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "eb2caba9f80616f438e09748d5acda951967e1ea58508ef53d9c6402485a46df" dependencies = [ "backtrace", "bytes", @@ -996,9 +996,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", @@ -1151,9 +1151,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" @@ -1194,7 +1194,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]] @@ -1214,18 +1214,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]] @@ -1236,9 +1236,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" @@ -1248,9 +1248,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" @@ -1260,15 +1260,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" @@ -1278,9 +1278,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" @@ -1290,9 +1290,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" @@ -1302,9 +1302,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" @@ -1314,6 +1314,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 index af0ac55d014..5f3aff30c76 100644 --- a/rust/bin/agent/src/handler/index.rs +++ b/rust/bin/agent/src/handler/index.rs @@ -16,6 +16,7 @@ use proto::{ core::v1::agent_server, payload::v1::{control, info, object, Empty}, + vald::v1::index_server, }; #[tonic::async_trait] @@ -41,7 +42,10 @@ impl agent_server::Agent for super::Agent { ) -> 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, @@ -50,11 +54,11 @@ impl agent_server::Agent for super::Agent { todo!() } - #[doc = " Represent the RPC to get the vector metadata. This RPC is mainly used for index correction process\n"] - async fn get_timestamp( + #[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> { + 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 ba50ab83801..b021552c002 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 e69de29bb2d..00000000000 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 84255cb3a55..00000000000 --- 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 25051403a43..8b67f0a033e 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 32d1d10e7bc..21f5bbe9510 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 4ebd9c0cb45..3a8745c244c 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 e97aba2d017..60d1441ed8d 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 a09725a5f12..f50e396bfcf 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 d98bfeca534..2a9e2efbecb 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 592b07a9c66..62e9a794d03 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 dac182d975a..f606c67f1a5 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 f399a6f2bcd..be33d897915 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 89144dbc38f..da9594fd66f 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 e4598026796..85b169d0cbb 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 b50dd27dd92..a4cc55716f5 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 362617ca872..de3e42fc292 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 261d95596f3..99aed793ad1 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 6e9db4b4bb8..e777e8936cb 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 21574090598..ca222b7cf39 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 3aceb496784..062a7525f18 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 c043eea7767..585940699b5 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 e51138b8af9..2f2ce0df61a 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 18365ff7ad2..d16771deca3 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 dfa88c8ebba..40682b3dccc 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 8acb5ca441a..2c80271d5ae 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 cf8690732fe..b8e248f40bb 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 ec877613c7c..77b34ac5090 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 a95f2884441..9edf2a44f4b 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 9edf2a44f4b..a7c00da34f2 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 6b244dcd696..a1ef0cae183 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 4d54daddb61..c4e41f94594 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 e91d9be2a86..eda862a98c1 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 f77856a6f1a..a84947d6ffe 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 fd2a01863fd..15a27998172 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 15a27998172..1545d966571 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 4a36342fcab..944880fa15e 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 94dc0ec9104..cf8690732fe 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 94dc0ec9104..cf8690732fe 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 94dc0ec9104..cf8690732fe 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 94dc0ec9104..cf8690732fe 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 18091983f59..19811903a7f 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 f86fb9cbcf1..50aceaa7b71 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 850e742404b..815d5ca06d5 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 3eefcb9dd5b..815e68dd20e 100644 --- a/versions/actions/SOFTPROPS_ACTION_GH_RELEASE +++ b/versions/actions/SOFTPROPS_ACTION_GH_RELEASE @@ -1 +1 @@ -1.0.0 +2.0.8